Learn practical skills, build real-world projects, and advance your career

Course 2 week 1 lecture notebook 01

Create a Linear Model

Linear model using scikit-learn

We'll practice using a scikit-learn model for linear regression. You will do something similar in this week's assignment (but with a logistic regression model).

sklearn.linear_model.LinearRegression()

First, import LinearRegression, which is a Python 'class'.

# Import the module 'LinearRegression' from sklearn
from sklearn.linear_model import LinearRegression

Next, use the class to create an object of type LinearRegression.