← Lessons

quiz vs the machine

Silver1050

Machine Learning

The Linear Regression

Fit a straight line through data and read the world off its slope.

4 min read · intro · beat Silver to climb

The model

Linear regression predicts a continuous target as a weighted sum of features plus a bias. For one feature the prediction is a straight line, y equals w times x plus b. With many features it becomes a flat plane in higher dimensions.

What the weights mean

  • Each weight says how much the prediction moves when its feature rises by one unit, holding the others fixed.
  • The bias is the prediction when every feature is zero.
  • Large absolute weights flag features the model leans on heavily.

Assumptions worth knowing

  • The relationship between features and target is roughly linear.
  • Errors are independent and have similar spread across the range.
  • Strongly correlated features make individual weights unstable and hard to read.

Why it stays popular

Linear regression is fast to fit, easy to interpret, and a strong baseline. If a fancy model cannot beat a clean linear fit, the extra complexity is rarely worth it.

Key idea

Linear regression models the target as a weighted sum of features. Its weights are directly interpretable, making it both a baseline and an explanation tool.

Check yourself

Answer to earn rating on the learn ladder.

1. What does a single weight in linear regression tell you?

2. When is linear regression most appropriate?