One formula for all the data
The topic Nearest neighbours predicts from nearby examples. Least squares instead fits one rule for the whole sample. Its prediction is ; a column of ones supplies an intercept. The design matrix contains the features, and contains the targets.
“Linear” means linear in the unknown weights. Columns may contain , or on its domain. Their values must be computable before choosing the weights. A weight inside does not meet this condition.
The objective is the average squared residual,
Multiplying it by a positive constant leaves its minimizer unchanged. Squared error has convenient geometry, but it also gives large residuals a large influence. We will connect the fitting rule, its assumptions and its validation.