AI Features

Implementation of Linear Regression

This lesson will provide an overview of linear regression and the steps involved in its implementation.

Quick overview of linear regression

Linear regression, as you may know, plots a straight line or plane called the hyperplane that predicts the target value of data inputs by determining the dependence between the dependent variable (y) and its changing independent variables (X). In a p-dimensional space, a hyperplane is a subspace equivalent to dimension p−1.

Thus, in a two-dimensional space, a hyperplane is a one-dimensional subspace/flat line. In three-dimensional space, a hyperplane is effectively a two-dimensional subspace. Although it becomes difficult to visualize a hyperplane in four or more dimensions, the notion of a p−1 hyperplane still applies.

The goal of the hyperplane is to bisect the known data points with minimal distance between itself and each data point. This means that if you were to draw a perpendicular line (90-degree angle) from the hyperplane to every data point on the plot, the distance of each data point would be the smallest possible distance of any potential hyperplane.

In preparation for building a linear regression model, you first need to remove or fill missing values and confirm that the independent variables are those ...

Ask