Principal component analysis (PCA) is an unsupervised machine learning algorithm used for dimensionality reduction. It converts correlated variables into uncorrelated principal components. PCA calculates the eigenvalues and eigenvectors of the covariance matrix to project the data onto a new feature space with fewer dimensions while retaining as much information as possible. The first principal component accounts for the largest variation in the data, with each subsequent component accounting for less variation.