Machine Learning · module 02 of 12

Linear Regression

Lessons

About This Lesson

Linear regression is the simplest and most widely used supervised learning model for predicting a number. It fits a straight line (or, with several inputs, a plane) through your data so you can predict a continuous value such as a price, a temperature, or a sales figure from one or more features.

You'll learn how the best-fit line is found with least squares, which minimizes the squared distance between the line and the data points, and how to judge the fit with R-squared. Then you'll extend the idea to multiple regression with more than one feature, and build and evaluate a linear regression model in Python with scikit-learn.

Watch the videos in order, then follow along in your own notebook. When you're done, continue on to Logistic Regression & Classification.

Lessons

3 videos
01

Linear Regression, Clearly Explained

The core ideas behind linear regression: fitting a line to data with least squares, and measuring how well it fits with R-squared.

02

Multiple Regression, Clearly Explained

How the same principles extend to more than one feature: fitting a plane or higher-dimensional surface, adjusting R-squared, and deciding whether extra features are worth adding.

03

Linear Regression with Single Variable in Python (scikit-learn)

A hands-on tutorial that predicts home prices from area using scikit-learn's LinearRegression: preparing the data, fitting the model, and making predictions.