df = None #Your code here
#Your code here
#Your code here
4. Define 4 variables: X_train, Y_train, X_test, Y_test using a 80-20 split for train and test data. X should be a matrix of data features predicting y, Domestic Gross Sales. Use random_state=42 for consistency.
from sklearn.model_selection import train_test_split
X = None
y = None
#Your code here
Create an instance of the LinearRegression class. Then use the fit method to train a model according to the data.
import sklearn.linear_model as linreg
#Create Instance of LinearRegression (Ordinary Least Squares Regressor)
#Fit the model to the train set
Create a Scatter Plot of the budget and Domestic Gross (domgross) along with your model's predictions.
%matplotlib inline
import matplotlib.pyplot as plt
#Scatter Plot
Define a function called rss(y,y_hat). Call it on the train and test sets.
def rss(y, y_hat):
pass
# print('RSS Training: {}'.format())
# print('RSS Test: {}'.format())