How does PCA use linear algebra?hard
Answer
PCA computes the eigenvectors of the data covariance matrix, then projects the data onto the top-k eigenvectors (principal components) that capture the most variance.
Explanation
Steps: (1) center the data (subtract mean), (2) compute the covariance matrix C = (1/n)XᵀX, (3) find eigenvectors/eigenvalues of C, (4) sort by eigenvalue descending, (5) project data onto top k eigenvectors. The result: k-dimensional representation that retains maximum variance. SVD of X directly gives the same result more efficiently. Explained variance ratio = eigenvalue / sum of all eigenvalues - tells you how much information each component retains.
Follow-upWhen would you use t-SNE or UMAP instead of PCA for dimensionality reduction?