Enrollments closing soon for Post Graduate Certificate Program in Applied Data Science & AI By IIT Roorkee | 3 Seats Left
Apply NowLogin using Social Account
     Continue with GoogleLogin using your credentials
Let's first train a LinearRegression
model on our training dataset and then predict the target variable for the data points.
Refer to LinearRegression documentation for further details about the estimator.
Import the estimator LinearRegression
from sklearn.linear_model
.
Create an instance of the estimator with the name lin_reg
.
Train the model on our training dataset i.e. (housing_prepared
, housing_labels
).
Predict the target variable for our training predictors i.e. (housing_prepared
) and store the output in a variable named predictions
.
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...