179 questions
No questions match those filters.
Why do you need to center (and usually scale) your data...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansPCA finds the directions of maximum variance in your data by eigendecomposing the covariance matrix, and covariance is defined relative to the mean — if you skip centering, the first “principal component” partly just points toward wherever the data’s mean sits relative to the origin, rather than capturing the actual axis of spread, mixing location with shape. Scaling matters for a different reason: PCA is variance-driven and variance is unit-dependent, so a feature measured in grams instead of kilograms gets a thousand times more variance and dominates the first component for no meaningful reason — standardize features (or at least equalize their scales) whenever they’re in different units, and treat it as the safe default.
On the SVD side, if you mean-center your n×p data matrix X, its covariance matrix is (1/(n-1))XᵀX, and the eigenvectors of XᵀX are exactly the right singular vectors of X, with eigenvalues equal to the squared singular values divided by (n-1). So computing PCA via SVD of the centered X directly is not just equivalent to eigendecomposing the covariance matrix, it’s numerically preferable — you avoid explicitly forming XᵀX, which squares the condition number and amplifies numerical error, especially when p is large.