Introducing linear regression
The goal of linear regression is to model the relationship between one or multiple features and a continuous target variable. As discussed in Chapter 1, Giving Computers the Ability to Learn from Data, regression analysis is a subcategory of supervised machine learning. In contrast to classification—another subcategory of supervised learning—regression analysis aims to predict outputs on a continuous scale rather than categorical class labels.
In the following subsections, we will introduce the most basic type of linear regression, simple linear regression, and relate it to the more general, multivariate case (linear regression with multiple features).
Simple linear regression
The goal of simple (univariate) linear regression is to model the relationship between a single feature (explanatory variable x) and a continuous valued response (target variable y). The equation of a linear model with one explanatory variable is defined as follows:

Here, the weight represents...