- Drop the Price column from the x_df dataframe and save it into a new dataframe named x_df2 using the following script:
x_df2 = x_df.drop(['price'], axis = 1)
- Declare a variable named reg and equate it to the LinearRegression() function from the Scikit Learn library using the following script:
reg=linear_model.LinearRegression()
- Split the dataset into test and train using the following script:
x_train,x_test,y_train,y_test = train_test_split(x_df2,y_df,test_size=0.4,random_state=4)
- Fit the model over the training set using the following script:
reg.fit(x_train,y_train)
- Print the coefficients generated from applying linear regression to the training and test sets by using the reg.coef_ command.
- Take a look at the ...