# Principal component analysis (PCA)

> Canonical: https://skillalmanac.com/glossary/principal-component-analysis | Last verified: 2026-11-24 | Index status: index-eligible

Principal component analysis (PCA) is a linear technique that expresses centered data along orthogonal directions called principal components, ordered by the variance they explain. Keeping only leading components reduces dimensionality.

Also called: PCA, PCA machine learning, PCA algorithm, principal components.

## In plain language

PCA takes a table of numeric columns and builds new columns from them. Each new column is a combination of the original ones. The first new column captures the most variation in the data, and each later one captures no more variation than the preceding one. You can keep the first few and drop the rest. PCA is a linear technique, so it suits linear relationships between variables better than non-linear ones, and IBM advises evaluating whether the data needs normalization first.

## Technical definition

PCA decomposes a multivariate dataset into successive orthogonal components that explain a maximum amount of the variance (scikit-learn). The components are linear combinations of the original variables, and the second component must be uncorrelated with the first (IBM). In scikit-learn, PCA centers but does not scale each feature before applying the singular value decomposition (SVD), learns its components in fit, and can then project new data onto them. IBM contrasts PCA, a linear technique, with the non-linear t-SNE and UMAP.

## How it shows up when you use agents

PCA is a data-analysis technique rather than a coding-agent feature. IBM says it is commonly used for data preprocessing for machine learning algorithms and helps visualize high-dimensional data by projecting it into a 2D or 3D plot. In scikit-learn, PCA is implemented as a transformer object. An agent asked to explore or compress a table of numbers for a [machine learning](/glossary/machine-learning) model may reach for it.

Scaling matters. scikit-learn centers the data but does not scale it, and IBM says PCA can bias towards specific features, so it is important to evaluate whether normalization is needed.

Interpretation takes care. IBM notes that keeping more components retains more variation, but the results may be harder to interpret. PCA is one technique for [dimensionality reduction](/glossary/dimensionality-reduction).

## Worked example: new axes, not selected columns

For a toy dataset with rows `(1, 1)`, `(2, 2)` and `(3, 3)`, subtracting each column's mean gives `(-1, -1)`, `(0, 0)` and `(1, 1)`. A first principal direction is `(1/√2, 1/√2)`. Projecting onto it gives scores `-√2`, `0` and `√2`. The perpendicular direction has zero variance for this chosen dataset, so one component represents its centered variation exactly.

The component combines both input columns. That differs from selecting one original column. The result is special to these perfectly collinear points; dropping components from a general dataset can discard variation. This is a hand calculation, not an empirical claim about a real dataset.

## Common confusions

- **PCA versus dimensionality reduction.** PCA is one method. IBM lists others, including linear discriminant analysis, UMAP and t-SNE. See [Dimensionality reduction](/glossary/dimensionality-reduction).
- **PCA versus original features.** PCA's components are linear combinations of the original variables, so they are new variables, not columns of the original table. See [Feature engineering](/glossary/feature-engineering).
- **PCA versus supervised methods.** IBM says that, in contrast to LDA, PCA is not limited to supervised tasks and can reduce dimensions without considering class labels. See [Unsupervised learning](/glossary/unsupervised-learning).
- **Myth.** The first component is the most important feature. IBM defines it as the direction along which the data points have the highest variance, and components are combinations of variables rather than single original features.

## Worked examples in this catalogue

### [data-analysis-eda](https://skillalmanac.com/skills/skill-almanac/data-analysis-eda)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A fixed exploratory-analysis procedure and CSV profiler that keeps findings descriptive, evidenced and caveated.

Why it exercises the concept: IBM says PCA is often used in exploratory data analysis, the kind of work this skill covers.

## Related terms

- [Dimensionality reduction](https://skillalmanac.com/glossary/dimensionality-reduction.md)
- [Unsupervised learning](https://skillalmanac.com/glossary/unsupervised-learning.md)
- [Machine learning (ML)](https://skillalmanac.com/glossary/machine-learning.md)
- [Feature engineering](https://skillalmanac.com/glossary/feature-engineering.md)
- [Embedding](https://skillalmanac.com/glossary/embedding.md)

## Sources

- [2.5. Decomposing signals in components (matrix factorization problems)](https://scikit-learn.org/stable/modules/decomposition.html), scikit-learn (accessed 2026-11-24)
- [sklearn.decomposition.PCA](https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html), scikit-learn (accessed 2026-11-24)
- [What is principal component analysis (PCA)?](https://www.ibm.com/think/topics/principal-component-analysis), IBM (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
