0PricingLogin
Data Science Academy · Lesson

Train a Linear Regression

A complete end-to-end example.

A Line Through Data

Linear regression fits a straight-line relationship between your features and a numeric target. It is the classic first model for a reason. 📈

Import the Model

The estimator lives in the linear_model module. You import it once and reuse it for any regression task you meet.

from sklearn.linear_model import LinearRegression

All lessons in this course

  1. The fit and predict Contract
  2. Features X and Target y
  3. Train a Linear Regression
  4. Score Your First Model
← Back to Data Science Academy