blackblack
picture picture

Ch 6.3: Dimension Reduction - PCA

Lecture 19 - CMSE 381
Michigan State University
::
Dept of Computational Mathematics, Science /span> Engineering
Mon, March 9, 2026
Announcements

Last time:

This lecture:

Announcements:

Screenshot of the course schedule for lectures
11 to 20.

Section 1 picture picture

Last time
Goal

Y = β0 + β1X1 + β2X2 + β3X3 + β4X4
Shrinkage

Find β to minimize:
Least Squares:
𝑅𝑆𝑆 = i=1n(y i ŷi )2
Ridge:
𝑅𝑆𝑆 + λ j=1pβ j2

The Lasso:

𝑅𝑆𝑆 + λ j=1p|β j|
Diagram illustrating the geometric
constraint used in ridge regression.

Diagram illustrating the geometric
constraint used in lasso regression.

What will you learn from this lecture?

Section 2 picture picture

Dimension Reduction
Linear transformation of predictors

Original Predictors:
X1,,Xp
New Predictors:
Z1,,ZM
Zm = j=1pφ 𝑗𝑚Xj
An example or two

Geometric interpretation

Diagram illustrating projection of a point
onto a line as a geometric interpretation
of dimensionality reduction.
Different projections

Diagram showing different
projections of data points
onto a line in a
dimensionality reduction
example.
First projection example in a dimensionality
reduction illustration. Second projection example in
a dimensionality reduction illustration. Third
projection example in a dimensionality reduction
illustration. Fourth projection example in a
dimensionality reduction illustration.
Histograms of Z values

First
projection
example
in
a
dimensionality
reduction
illustration. Histogram
of
projected
z
values
for
the
first
projection
example.
Second
projection
example
in
a
dimensionality
reduction
illustration. Histogram
of
projected
z
values
for
the
second
projection
example.
Third
projection
example
in
a
dimensionality
reduction
illustration. Histogram
of
projected
z
values
for
the
third
projection
example.
Fourth
projection
example
in
a
dimensionality
reduction
illustration. Histogram
of
projected
z
values
for
the
fourth
projection
example.
The goal

yi = 𝜃0 + m=1M𝜃 mz𝑖𝑚 + 𝜀i

Section 3 picture picture

PCA
An example dataset

Scatter plot of an example dataset with
two input variables and a line showing the
principal component direction of greatest
variability.
Projection onto first PC

Scatter plot showing an example dataset projected onto the first principal component, with the
principal component direction and the mean point indicated.

Z1 = 0.839 (𝚙𝚘𝚙𝚙𝚘𝚙¯) + 0.544 (𝚊𝚍𝚊𝚍¯)
What does it mean to have the highest variance

Scatter plot showing an example dataset
projected onto the first principal
component, with the principal component
direction and the mean point indicated.
Toy for learning PCA

https://www.desmos.com/calculator/gvmq07pg1k
Principal component scores

Diagram illustrating principal component scores obtained by projecting observations onto the first
principal component direction.

zi1 = 0.839(𝚙𝚘𝚙i𝚙𝚘𝚙¯)+0.544(𝚊𝚍i𝚊𝚍¯)
Another view

Rotated view of the example dataset showing observations in relation to the first principal component
and their principal component scores.

The other principal components

Do PCA with Penguins

TL;DR

PCA

Scatter plot showing an example dataset
projected onto the first principal component,
with the principal component direction and
the mean point indicated.

Next time

Screenshot of the course schedule for lectures 11 to 20.