Skip to content
BENIBIX Learn

Linear Regression

AI📈 Machine LearningClassic ML Algorithms

Also known as Ordinary Least Squares, OLS

Guessing a number with a straight line. The line is the one that best fits the data.

Think of it like

Think of it like a page of dots. You lay a ruler down the middle of them.

Example

Jack plots flat size against rent for 300 flats. The best line says each extra square metre adds about 15 euros a month.

Why it matters

It is often the first model to try and the one to beat. Its weights tell you plainly what moves the answer.

Definition

Linear regression is a method that guesses a number by drawing the straight line that best fits the data. Each feature gets a weight that says how much it pushes the answer up or down. Training finds the weights that make the line miss the dots by the least. It is simple, fast and easy to explain. It works best when the real link is close to a straight line.
Linear regression is the left panel. You read the answer off one straight line, as a number.

Common mistake

Using it on a curved pattern. If rent jumps sharply in the city centre, a straight line misses it badly.

Key takeaways

  1. 1
    A straight line. The simplest shape to fit.
  2. 2
    One weight each. How much each feature counts.
  3. 3
    Easy to explain. You can read the weights.

Compare

Learn it properly