Loading…
Glossary term
A technique that reduces the number of variables while preserving as much variation as possible.
PCA finds the directions along which the data varies the most and re-expresses the data along them. Keeping only the first few components gives a compact summary that preserves most of the information.
It is a linear method and is also used for visualization and noise removal.
PCA with scikit-learn
from sklearn.decomposition import PCA
reduced = PCA(n_components=2).fit_transform(X)It is the standard tool for reducing many variables to a few that still capture the main patterns.