Skip to learning content

DATA SCIENCE PYTHON PLAYGROUND

Machine Learning · Learn / Refresh

← Choose a model deck
TEACHING COLLECTION

Principal component analysis

Fit reusable axes, choose retained variation and interpret weights, scores and the limits of a two-dimensional view.

Helpful prior knowledge: Distance depends on scale and context. These links are guidance, not locks.

Follow teaches the idea; Change asks you to make a choice; Transfer changes the context. Apply, reviews and checkpoints appear where the existing lessons provide them. Go Further lessons are optional.

Lessons in this model deck

P01Core · teaching
New coordinates, not selected original columns: Original X, New axes, ScoresOriginal XNew axesScores

New coordinates, not selected original columns

Distinguish PCA from feature selection and clustering.

12–18 min · 3 practices
P02Core · teaching
Fit a reusable PCA representation: Fit scaler, Fit PCA, Transform new XFit scalerFit PCATransform newX

Fit a reusable PCA representation

Transform rows with the fitted axes and scale.

20–30 min · 4 practices
P03Core · teaching
Explained variance is not predictive accuracy: Variance kept, Prediction score, Not equivalentVariance keptPrediction scoreNot equivalent

Explained variance is not predictive accuracy

Interpret per-component variation.

12–18 min · 3 practices
P04Core · teaching
Select a retained representation: Component shares, Retained prefix, Target variance60%25%10%5%Component sharesRetained prefixTarget variance

Select a retained representation

Choose the smallest component prefix meeting a variance criterion.

12–18 min · 3 practices
P05Core · teaching
Component weights and scores: Feature weights, Row scores, Keep IDsFeatureweightsRow scoresKeep IDsfeatureaxis weightcomponentrow IDaxis scorelocation

Component weights and scores

Distinguish feature-axis weights from row coordinates.

12–18 min · 3 practices
P06Core · teaching
Two dimensions are a view: Two-axis view, Other axes, Lost detailRetain k axesDisplay two axesReport omitted variance

Two dimensions are a view

Separate a display from the retained representation.

12–18 min · 3 practices
P-R1Core · review
PCA retrieval: Scale then PCA, Retain variance, Read loadingsScale then PCARetain varianceRead loadings

PCA retrieval

Retrieve earlier concepts before combining them.

15–20 min · 3 practices
P07Go Further · teaching
Equivalent signs and reconstruction: Flip both signs, Same projection, Same rebuilt XFlip both signsSame projectionSame rebuilt X

Equivalent signs and reconstruction

Understand equivalent representations and information loss.

18–25 min · 4 practices
P-K1Core · checkpoint
PCA checkpoint: Penguin X, Retain axes, Explain plotPenguin XRetain axesExplain plot

PCA checkpoint

Fit Penguin PCA, retain at least 90% variance, label weights and report the separate 2D view.

25–35 min · 1 practices

Browse all PCA lessons, reviews and checkpoints →

Choose an independent workflow challenge →