Homework 7: Correlation, Regression, and Least
Squares
This assignment is due Thursday, November 9 at 11:59PM. You will receive an early submission bonus point if
you turn it in by Wednesday, November 8 at 11:59PM. Di
...
Homework 7: Correlation, Regression, and Least
Squares
This assignment is due Thursday, November 9 at 11:59PM. You will receive an early submission bonus point if
you turn it in by Wednesday, November 8 at 11:59PM. Directly sharing answers is not okay, but discussing
problems with course staff or with other students is encouraged. Passing the automatic tests does not
guarantee full credit on any question. The tests are provided to help catch some common errors, but it is your
responsibility to answer the questions correctly.
Reading:
Textbook chapter 12 (https://www.inferentialthinking.com/chapters/12/why-the-mean-matters.html) (for
review)
Textbook chapter 13 (https://www.inferentialthinking.com/chapters/13/prediction.html)
Run the cell below to prepare the notebook.
In [8]: # Run this cell to set up the notebook, but please don't change it.
import numpy as np
from datascience import *
# These lines do some fancy plotting magic.
import matplotlib
%matplotlib inline
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
import warnings
warnings.simplefilter('ignore', FutureWarning)
from matplotlib import patches
from ipywidgets import interact, interactive, fixed
import ipywidgets as widgets
# Don't change this cell; just run it.
from client.api.notebook import Notebook
ok = Notebook('hw07.ok')
ok.auth(inline=True);
When you are finished, run the following cell to submit your work.
=====================================================================
Assignment: Homework 7: Correlation, Regression, and Least Squares
OK, version v1.12.5
=====================================================================
In [128]: ok.submit();
1. Evaluating NBA Game Predictions
A brief introduction to sports betting
In a basketball game, each team scores some number of points. Conventionally, the team playing at its own
arena is called the "home team," and the other team is called the "away team." The winner is the team with the
most points.
We can summarize what happened in a game by the "outcome", defined as
[Show More]