VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

The Core Aim of Mathematics Mastery | Principal Component Analysis (PCA)

A student in a blue-and-white uniform sits with an open book on a sunlit stone bench, with a bag and a small stack of books beside her.

Imagine a classroom spreadsheet with dozens of measurements for every student. Some measurements overlap: reading speed and words read in a minute, for example, may tell similar stories. If we keep every column, the patterns become hard to see. But if we throw columns away indiscriminately, we risk losing useful information. Principal component analysis offers a mathematically disciplined alternative.

The core aim of principal component analysis (PCA) mastery is to understand how high-dimensional numerical data can be represented along new directions that capture as much variation as possible. Students learn to centre and sometimes standardise data, interpret covariance, use eigenvectors and eigenvalues to find principal directions, project observations, read explained variance and recognise what is lost when dimensions are removed. PCA is not magic compression. It is a geometric choice about which variation to preserve.

This advanced mathematics topic continues the eduKateSG Mathematics Mastery route after Eigenvalues and Eigenvectors, Matrices, Standard Deviation and Scatter Graphs and Correlation. For the specialist mathematics of covariance, see How Covariance Works. This article owns the mastery outcome: how to use covariance eigenvectors to select, interpret and evaluate lower-dimensional representations.


Why Do We Need Dimensionality Reduction?

If a dataset records two features, each observation can be plotted as a point in a plane. Three features produce a point in three-dimensional space. With fifty features, there is no simple diagram that shows every dimension at once.

Some variables also move together, which means the dataset may contain considerable redundancy. PCA searches for new coordinate directions that describe the spread of the data more economically. The goal is not to discard columns by intuition, but to find directions in the feature space that systematically explain variation.

Start With a Picture: A Tilted Cloud of Points

Imagine plotting height on the horizontal axis and arm span on the vertical axis. If taller people tend to have longer arm spans, the points form an elongated cloud rather than a round one.

The first principal component points along the long direction of this cloud. The second is perpendicular to it and captures the remaining spread. That is the geometry of PCA in two dimensions: rotate the axes to align with the directions where the data vary most.

Centre the Data Before Finding Directions

For each numerical feature, calculate its mean and subtract that mean from every observation. This is called centering.

For example, if the values are 4, 6 and 8, their mean is 6 and the centred values are −2, 0 and 2.

After centering, the data cloud is positioned around the origin. PCA can then focus on variation around the mean rather than the arbitrary numerical location of the original measurements.

Standardisation Is a Separate Decision

Centering does not make feature scales comparable. A measurement recorded in millimetres can have much larger numerical variation than a feature recorded on a small rating scale, even if the second feature is equally important to the question.

Standardisation commonly subtracts the mean and divides by the standard deviation, giving features a common scale. Whether to standardise depends on what the units and variances mean. PCA on raw covariance and PCA on standardised data may produce very different components.

Covariance Measures Co-Movement

Covariance asks whether two centred numerical variables tend to vary in the same direction. Positive covariance suggests that values above the mean in one variable often occur alongside values above the mean in another; negative covariance suggests an opposite pattern.

A covariance matrix collects these relationships. The diagonal entries are individual variances; the off-diagonal entries describe pairwise co-movement.

For a full explanation of sample and population conventions, see How Covariance Works.

The Covariance Matrix Is the Key Input

Suppose our illustrative two-feature covariance matrix is:

C=[[9,6],[6,9]].

Each feature has variance 9, and the features have positive covariance 6. The matrix is symmetric, as covariance matrices must be. It also has non-negative eigenvalues, as required for a valid covariance matrix.

Eigenvectors Find the Principal Directions

A covariance-matrix eigenvector u satisfies Cu=λu. In PCA, eigenvectors identify orthogonal directions of variation, while their corresponding eigenvalues measure how much variance lies along each direction.

Order the eigenvectors by descending eigenvalue. The first principal component points in the direction of maximum variance. The second captures the greatest remaining variance while staying perpendicular to the first.

Worked Example: Find Two Principal Components

For C=[[9,6],[6,9]], solve det(C−λI)=0:

(9−λ)²−36=0.

This gives eigenvalues λ₁=15 and λ₂=3.

Corresponding unit eigenvectors can be chosen as:

  • u₁=(1,1)/√2, along the positive diagonal;
  • u₂=(1,−1)/√2, along the perpendicular diagonal.

The first direction follows the dominant co-movement of the two features. The second records differences between them.

Explained Variance Gives a Quantitative Summary

The total variance in this illustrative covariance matrix is the sum of its eigenvalues:

15+3=18.

The first component’s explained-variance proportion is:

15/18≈83.3%.

The second contributes 3/18≈16.7%.

Keeping only the first component would preserve about 83.3% of the total variance of these two centred features. It would not preserve 83.3% of every possible meaning, relationship or future prediction.

Projection Converts Original Features Into Component Scores

Once a unit principal direction u has been found, a centred observation x can be projected onto it using the dot product x·u. The result is the observation’s score along that component.

For example, if x=(2,0) and u₁=(1,1)/√2, the first-component score is:

x·u₁=2/√2=√2.

The score is a new coordinate. It measures how far the observation lies along the selected principal direction, not its original value on either input feature.

Reconstruction Reveals What Was Lost

If we retain only u₁, a centred point x is approximated by (x·u₁)u₁. For x=(2,0), this gives (1,1).

The approximation differs from the original point by (1,−1). That residual is what the discarded second component carried for this observation.

Good dimensionality reduction acknowledges reconstruction error instead of pretending that fewer coordinates contain the same information without loss.

Principal Components Are New Variables, Not Selected Original Columns

PCA normally constructs linear combinations of original features. It is therefore different from simply choosing a subset of existing columns.

In a height-and-arm-span example, the first component could represent an overall body-size direction, while the second captures how arm span differs relative to height. The exact interpretation depends on the dataset and the coefficients, so labels must be justified rather than invented.

Signs of Eigenvectors Are Arbitrary

If u is an eigenvector, then −u is also an eigenvector for the same eigenvalue. Software can reverse the sign of a principal-component axis without changing the PCA subspace or explained variance.

This is a common source of confusion when comparing component loading tables from two programs. The direction of the axis is arbitrary; the geometry is what matters.

How Many Components Should We Keep?

A cumulative explained-variance curve helps show how much variation is captured by the first k components. A researcher may look for a useful balance between simplicity and retained variance, but there is no universally correct percentage for every task.

The decision should reflect the purpose: visualisation, compression, noise reduction, exploratory analysis or preparation for another model. A small component count can be appealing without being adequate for the decision that follows.

A Scree Plot Helps Compare Eigenvalues

A scree plot displays the ordered eigenvalues or explained-variance amounts. A sharp fall followed by a flatter tail can suggest a natural reduction in component count.

The plot is a diagnostic, not a guarantee. Students should still check reconstruction quality and whether important structures survive the projection.

PCA Is Unsupervised

Ordinary PCA chooses directions by variance in the feature data; it does not use a target label such as a student’s exam result or a customer’s future purchase when selecting components.

A direction of high variance may be irrelevant to prediction, while a low-variance direction may contain a useful signal. This is why “maximum explained variance” and “best prediction” must not be treated as the same goal.

Outliers Can Distort Principal Directions

Covariance-based PCA is sensitive to unusually large deviations. One extreme observation can pull the principal direction toward itself, making the result less representative of the majority of the data.

Before interpreting a PCA diagram, inspect the distribution, measurement quality, missing values and outliers. An elegant plot is not evidence that its inputs were sound.

Correlated Features Are Where PCA Often Helps Most

When several features share substantial variation, a smaller set of principal components can capture much of that common structure. If features are largely independent and equally variable, reducing them may discard more information.

This connects PCA directly to Scatter Graphs and Correlation and to the mathematics of Covariance.

PCA Is Also a Matrix Factorisation Problem

In practical data analysis, PCA can be computed using a singular value decomposition (SVD) of the centred data matrix. The right singular vectors identify principal directions, and the singular values connect to the eigenvalues of the covariance matrix through their squares and the sample-size convention.

This is computationally useful because it can avoid explicitly forming the covariance matrix for many datasets. Conceptually, the principal directions and explained-variance logic remain the same.

PCA and Visualisation

Plotting observations on the first two components can reveal broad patterns or outliers that are difficult to see in the original high-dimensional features.

But a two-dimensional PCA plot is a projection. Points that appear near one another may differ in discarded dimensions; separated clusters on the plot are not automatically evidence of meaningful categories.

PCA and Artificial Intelligence

PCA is useful for exploring numerical representations and for certain forms of preprocessing or compression. Its geometric idea of projection also helps students think clearly about modern embedding spaces.

For a related exploration beyond school mathematics, see Vector Space: The Geometry Behind Embeddings, Similarity and Retrieval. PCA is one specific linear technique, not a substitute for every nonlinear representation method.

Do Not Leak Information Across a Train–Test Split

If PCA is used as part of a predictive machine-learning workflow, centering, scaling and principal directions should be estimated from the training data, then applied unchanged to validation and test observations.

Fitting PCA to the entire dataset before evaluation can leak information from held-out observations into the preprocessing. That can make a model’s apparent performance less trustworthy.

Common PCA Misconceptions

  • Skipping centering without understanding the consequences.
  • Assuming all feature scales are automatically comparable.
  • Confusing eigenvalues with eigenvectors.
  • Thinking PCA simply picks the most important original columns.
  • Interpreting explained variance as predictive accuracy.
  • Assuming a 2D projection preserves all relationships.
  • Forgetting eigenvector signs can reverse without changing the subspace.
  • Ignoring outliers and data quality.
  • Using information from test data to fit preprocessing.

Three Pathways for Building PCA Mastery

Repair: Statistics and Geometry

Rebuild means, centering, variance, covariance, coordinate directions and dot products. Sketch an elongated two-dimensional point cloud and identify its long and short directions before introducing a matrix.

Stabilise: Calculate and Interpret

Use a small symmetric covariance matrix, find its eigenvalues and eigenvectors, calculate explained variance, project one point and explain the effect of discarding a component.

Extend: Model and Evaluate

Compare covariance-based and correlation-based PCA, inspect reconstruction error, study SVD and test how outliers or feature scaling change the directions. Then assess whether PCA serves the actual analysis goal.

A Weekly PCA Practice Routine

  • Centre two short numerical columns.
  • Explain their covariance and sketch the scatter cloud.
  • Find eigenvalues for a simple 2×2 covariance matrix.
  • Match eigenvectors to principal directions.
  • Calculate explained-variance percentages.
  • Project a centred point and discuss what information a one-component approximation loses.

How Parents and Learners Can Recognise Progress

  • I can explain why reducing dimensions might help.
  • I can centre features and explain when scaling matters.
  • I can interpret a covariance matrix.
  • I can find principal directions from eigenvectors.
  • I can interpret eigenvalues as variances.
  • I can calculate explained-variance ratios.
  • I can project an observation onto a component.
  • I can explain reconstruction loss.
  • I know PCA is unsupervised.
  • I can identify a scenario where PCA might mislead.

Frequently Asked Questions

What is principal component analysis in simple terms?

PCA is a linear method that rotates the feature axes to find directions explaining the most variance, then optionally keeps only some of those directions.

Why do eigenvectors matter in PCA?

Eigenvectors of the covariance matrix identify the principal directions; their eigenvalues give the variance along those directions.

Does 90% explained variance mean 90% accuracy?

No. Explained variance measures retained variation in the input data, not accuracy on a prediction or classification task.

Is PCA part of ordinary secondary-school mathematics?

PCA is generally an advanced statistics and linear-algebra topic. It makes a useful extension after students are secure with vectors, matrices, covariance and eigenvalues, rather than replacing their school syllabus foundations.

Helpful Reading in the eduKateSG Mathematics Ecosystem

The Core Aim

The core aim of PCA mastery is not to make students push a dataset through software and admire a colourful two-dimensional plot. It is to understand which variation is being preserved, which is being lost, and why those choices are mathematically defensible.

A strong learner can move between data, covariance, eigenvectors, projections and explained variance—and knows that a simpler picture is useful only when its limitations are understood. That is how PCA turns dimensionality reduction into genuine mathematical thinking.