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 LinearRegressionAll lessons in this course
- The fit and predict Contract
- Features X and Target y
- Train a Linear Regression
- Score Your First Model