Mathematics for Machine Learning

Learn / Mathematics for Machine Learning

09 - Linear Regression

Advanced mastery of Chapter 9, covering every named section and exercise-style synthesis across book pages 289-315.

Learning path

0%

0 of 4 sections marked complete · about 42 minutes

Learning objectives

What you will be able to explain

  • Regression formulation
  • Design-matrix discipline
  • Normal-equation estimator
  • Fit a line exactly
  • Least squares as MLE
  • Regularized regression

Section 01

Regression formulation to Normal-equation estimator

01

Regression formulation

Linear regression is linear in parameters, with features collected in the design matrix.

Guided checkpoint

Match object in y=Xtheta+ϵy=Xtheta+\epsilon.

Source: Sec. 9.1, pp. 291-292

02

Design-matrix discipline

Nonlinear basis functions remain linear regression when parameters enter linearly.

Guided checkpoint

Judge each statement.

Source: Sec. 9.1, pp. 291-292

03

Normal-equation estimator

Stationarity of squared error yields XTXtheta=XTyX^TXtheta=X^Ty.

Guided checkpoint

For full-column-rank XX, OLS gives:

Source: Sec. 9.2, pp. 292-303

Section 02

Fit a line exactly to Regularized regression

01

Fit a line exactly

The first point fixes a=1a=1 and the second gives 5=1+2b5=1+2b.

Guided checkpoint

Fit y=a+bxy=a+bx through points (0,1)(0,1) and (2,5)(2,5).

Source: Sec. 9.2, pp. 292-303

02

Least squares as MLE

The Gaussian negative log-likelihood is quadratic in residuals.

Guided checkpoint

Assume i.i.d. Gaussian observation noise.

Source: Sec. 9.2, pp. 292-303

03

Regularized regression

L2L_2 shrinkage stabilizes inversion; exact sparsity is associated more with L1L_1.

Guided checkpoint

For ridge regression.

Source: Sec. 9.2, pp. 292-303

Section 03

Bayesian linear regression to Maximum likelihood as projection

01

Bayesian linear regression

Gaussian conjugacy yields analytic posterior and predictive distributions.

Guided checkpoint

Match quantity.

Source: Sec. 9.3, pp. 303-313

02

Posterior predictive uncertainty

Bayesian prediction integrates parameter uncertainty rather than only plugging in a point.

Guided checkpoint

Judge each claim.

Source: Sec. 9.3, pp. 303-313

03

Maximum likelihood as projection

The residual is orthogonal to every design-matrix column.

Guided checkpoint

OLS fitted values are best described as:

Source: Sec. 9.4, pp. 313-315

Section 04

Regression geometry to Exercise-style residual check

01

Regression geometry

Projection need not interpolate when yy lies outside the column space.

Guided checkpoint

At an OLS solution.

Source: Sec. 9.4, pp. 313-315

02

Further-reading bridge

Basis expansion and Bayesian regression lead naturally to kernel methods.

Guided checkpoint

Which extension handles nonlinear function spaces through kernels or priors?

Source: Sec. 9.5, p. 315

03

Exercise-style residual check

Estimate is mean 3; residuals are -1 and 1, with squared norm 2.

Guided checkpoint

For X=[1,1]TX=[1,1]^T, y=[2,4]Ty=[2,4]^T, fit the intercept-only OLS model. What is the residual squared norm?

Source: Chapter 9 synthesis, pp. 291-315

Knowledge check

Turn understanding into recall.

The quiz now follows the same concepts in scored form. You can return to this lesson from the quiz whenever a gap appears.