Locked lesson.
About this lesson
In this video, learn how to train a linear regression model and how easy it is to fit the model.
Exercise files
Download this lesson’s related exercise files.
Train a Linear Regression Model and Fit The Model.docx57 KB Train a Linear Regression Model and Fit The Model - Solution.docx
55.6 KB
Quick reference
Train a Linear Regression Model and Fit The Model
Now it's time to create an instance of our Linear Regression and fit the Training data to the model.
When to use
Do this whenever you want to create a Linear Regression Model.
Instructions
First create an instance of a Linear Regression model:
lin = LinearRegression()
Next fit our training data to the model:
lin.fit(X_train, y_train)
Hints & tips
- lin = LinearRegression()
- lin.fit(X_train, y_train)
Lesson notes are only available for subscribers.