2.5.9 · D5Unsupervised Learning
Question bank — PCA via eigendecomposition and SVD
Before we start, a tiny shared vocabulary so no symbol appears unearned:

Look at the figure: the grey dots are the data cloud, the two arrows are the PCs (long, big ) and (short, small ), and the coloured tick marks on the long arrow are the shadows (projections) — their spread is the variance along .
True or false — justify
PCA components are always orthogonal (at right angles) to each other.
True. is symmetric, and symmetric matrices have eigenvectors that can always be chosen mutually orthogonal — so the PCs form a clean set of perpendicular axes.
The first principal component always passes through the origin.
True after centering — because we subtract the mean, the cloud is centered at the origin and the PC is a direction (arrow from origin), not a line floating in space.
If two features are already uncorrelated but have very different variances, PCA cannot compress them.
False — it still compresses. With unequal variances is diagonal but not a scaled identity; the feature with the larger variance becomes PC 1 and the smaller one can be dropped. Compression only fails in the special case where the variances are also equal (a scaled identity), because then every direction is equally "principal."
The eigenvalues of the covariance matrix can be negative.
False. is positive semi-definite (it is a sum of squares), so every eigenvalue ; a "negative variance" is meaningless.
Doubling the units of one feature (e.g. cm → mm) leaves the principal components unchanged.
False. Multiplying a feature by 10 multiplies its variance by 100, so it hijacks the first PC. This is exactly why we often scale features first.
The projection (with the top- eigenvector matrix) reduces the number of samples.
False. It reduces the number of columns (features ); the number of rows (samples ) is untouched — each sample gets a shorter description, none disappear.
SVD and eigendecomposition of give the same principal components.
True. Substituting into shows the right singular vectors are the eigenvectors of , with .
A principal component and its negative ( vs ) represent different directions of variance.
False. They describe the same line of spread; sign is arbitrary because too. Different software may flip signs — this is not a bug.
PCA can only ever find directions that are straight lines through the data.
True for standard PCA. It is a linear method. For curved (nonlinear) structure you need Kernel PCA or autoencoders.
Spot the error
"I skipped centering because my data was already roughly in the positive quadrant."
Error: roughly positive ≠ centered at origin. Without subtracting the mean, the top PC points from the origin toward the mean — encoding location, not spread. Always center.
"I computed using the raw uncentered ."
Error: covariance requires the centered matrix. Using raw gives the second-moment matrix, whose top eigenvector is contaminated by the mean direction.
"I picked the eigenvector with the smallest eigenvalue as my first principal component to keep the important info."
Error: smallest = least variance = least information (often just noise). The first PC is the largest eigenvalue's eigenvector.
"My dataset has samples and my top singular value came out as , so the variance explained is ."
Error: the variance is , not itself. You must square and divide by .
"To decorrelate features I kept 's off-diagonal terms."
Error: decorrelation means removing off-diagonal covariance. Projecting onto the eigenvectors makes the new covariance matrix diagonal — that is the point.
"I formed the huge covariance matrix for my dataset with features and samples."
Error: wasteful and numerically shaky. With , use SVD directly on — it never builds the matrix and is more stable.
"Explained variance ratio for the top 2 PCs was 91%, so I have 91% of the samples."
Error: EVR is about variance (spread), not sample count. 91% means the 2D shadow preserves 91% of the cloud's total spread; all samples remain.
Why questions
Why do we divide by and not (with the number of samples) when forming ?
Because we already spent one "degree of freedom" estimating the mean to center the data; dividing by (Bessel's correction) makes the variance estimate unbiased.
Why does maximizing over unit-length directions (with ) force to be an eigenvector?
The Lagrange condition gives exactly — the definition of an eigenvector. So the best-spread direction has to be one of 's eigenvectors.
Why is the eigenvalue equal to the variance along its PC , not just proportional?
Plugging the eigenvector back in: , since . The unit-length constraint makes it exact.
Why can SVD avoid the numerical trouble that eigendecomposition of suffers?
Forming squares the condition number, amplifying rounding error. SVD works on directly, so the small singular values stay resolvable.
Why order the components by eigenvalue at all?
So we can greedily keep the top few and know exactly how much spread we're keeping — the ordering turns "which axes matter" into a simple ranked list.
Why is PCA called an unsupervised method?
It uses no labels or targets — it only looks at how the input features spread and co-vary, which is why it lives under Unsupervised Learning alongside K-Means.
Why does (the sum of 's diagonal entries equalling the sum of eigenvalues) let us compute EVR without ever finding eigenvectors?
The total variance (sum of diagonal variances) equals the sum of eigenvalues, so denominators in EVR are cheap — you can get "how much total spread" from the trace alone.
Edge cases
What happens when all data points are identical?
The centered matrix is all zeros, , every eigenvalue is 0. There is no variance to explain — PCA returns nothing meaningful.
What if two eigenvalues are exactly equal (a "tie")?
The two PCs are not uniquely defined — any orthonormal pair spanning that plane works equally well. The spread is circular in that plane, so no single "best" axis exists.
What if you request more components than the data's true rank?
The extra components have eigenvalue 0 and point in arbitrary directions within the null space; they add columns of essentially noise to and explain no variance.
What if (fewer samples than features)?
The covariance matrix is singular with at most nonzero eigenvalues; you can find at most meaningful PCs, and SVD is the sensible route.
What happens to PCA if one feature is a perfect copy of another?
The two columns are linearly dependent, making rank-deficient — one eigenvalue is exactly 0, and PCA correctly collapses the redundant pair into a single direction.
What does the last principal component (smallest ) tell you?
The direction of least spread — often a near-constant relationship or pure noise. It's what you throw away when compressing, but it can reveal hidden constraints in the data.
If every feature already has variance 1 and zero correlation, what does PCA return?
, so all eigenvalues equal 1 and every direction is equally principal. PCA gives no preferred axes and no compression is possible without loss.
Recall Quick self-check
One-line trap that catches most people ::: Confusing the singular value with the variance — remember variance is , never itself.