ML 3.1Free videoLesson 1 of 7 in Module 3
Simple Linear Regression
Predict a number from one feature with a straight line, choose the line that minimises squared error, and read what its slope and intercept say.
Watch the lesson: Simple Linear Regression
In this lesson12 parts
- 01Fuel economy from weight
- 02The training cars
- 03The mean as the baseline
- 04A line and its residuals
- 05Two numbers to choose
- 06Squared error
- 07Both partial derivatives at zero
- 08Predicting a car
- 09RMSE and R squared on the fitted rows
- 10Where a straight line goes wrong
- 11From scratch, then the library
- 12Recap, your challenge, and what comes next
Builds on
This lesson stands on its own. These go deeper into what it uses.
Key terms: Simple Linear Regression
The words this lesson introduces, each in one line. The module’s glossary collects them all, and the AI glossary has every term across the courses.
- baseline (reminder, ML 1.1)
- Here, the mean mpg for every car: RMSE 8.01.
- RMSE
- The square root of the mean squared error, in the units of the label.
- linear regression
- Predicting a number with a straight line, or with a weighted sum of features.
- slope
- The change in the prediction per unit of the feature.
- intercept
- The prediction when every feature is zero.
- residual
- The actual value minus the prediction.
- squared error
- A residual multiplied by itself.
- mean squared error
- The average of the squared residuals.
- least squares
- Choosing the parameters that minimise the squared error.
- contour map (reminder, Maths 4.4)
- Lines of equal loss over the plane of two parameters.
- R²
- One minus the model's squared error over the mean's squared error: the fraction of the mean's squared error the model removes.
- extrapolation
- Predicting outside the range of the training data.
Quiz: Simple Linear Regression
Your first pick on each question is the one that counts. Getting one wrong here is how the lesson sticks.