Scikit-learn will not throw an error when PCA has nothing useful to compress. It will give you components anyway.

Ten years ago, Principal Component Analysis was one of the sharpest tools in my kit. Correlated sensor readings, overlapping financial ratios, dozens of variables measuring similar things. It stripped away redundancy and gave me a smaller representation that trained faster and often generalised better.

I still see it in production pipelines, including code written by experienced teams. What has changed is how it gets there.

Not from examining the data, but from a template. StandardScaler(), then PCA(n_components=0.95). The pipeline runs. The explained variance reaches 95 per cent. Everyone moves on.

But 95 per cent of what?

PCA finds orthogonal directions that preserve the most variance. It does not know what you are predicting, or which variables matter.

Give it ten independent standardised features and the explained-variance ratios come back almost identical: 0.110, 0.105, 0.103, down to 0.093. To keep 95 per cent you need all ten. Nothing was compressed. You replaced ten named features with ten combinations of them.

The more expensive failure is quieter, so I simulated one to see it properly.

Ten sensors, arranged as five redundant pairs. In one pair the two readings drift apart when a fault is present, so the signal is the difference between them and not the level of either.

The first five components hold 99.2 per cent of the variance. The 95 per cent threshold keeps those five and drops the rest. A classifier on the ten standardised features scores 0.741. On the components kept at 95 per cent it scores 0.519. Always guessing the larger class would score 0.510.

Explained variance by principal component. The first five components each hold about twenty per cent of the variance. The remaining five are slivers near zero. A dashed line between components five and six marks where cumulative variance passes ninety-five per cent. Component six, shown in gold, explains 0.2 per cent of the variance and on its own scores 0.736.

The fault lives in component six. It explains 0.2 per cent of the variance and is the first one discarded. On its own it scores 0.736.

The rotation was not the problem. Keep all ten components and accuracy returns to 0.741 exactly. The discarding did it.

A contrast between redundant sensors is low-variance by construction. The shared level takes the variance and the divergence is what remains. Agreement is normal. Divergence is the fault.

Two checks take a minute. Does the variance concentrate into a few components, or rise like a gentle diagonal? And does the model actually improve on a held-out set when you use them?

PCA can preserve 95 per cent of the variance and still discard what matters.

The library cannot tell you whether that trade was a good one.