起源故事 · 从最佳拟合直线到主成分
Origin Story · From the best-fit line to principal components
1901 年,统计学先驱 Karl Pearson 在一篇论文里问了个几何问题:给定一团散点,哪条直线离所有点"整体最近"?
他发现答案正是方差最大的方向。三十多年后的 1933 年,经济学家 Harold Hotelling 把它推广成系统方法,
并正式起名"主成分(principal components)"。一句话:PCA 不是删掉变量,而是换一套更聪明的坐标轴 ——
让新坐标的第一根轴扛走最多信息,于是高维数据可以用极少几根轴近似表达。
In 1901, statistics pioneer Karl Pearson asked a geometric question in a paper: given a cloud of points, which straight line is "overall closest" to all of them?
The answer turned out to be the direction of maximum variance. Three decades later, in 1933, economist Harold Hotelling generalised the idea into a full method
and gave it its official name — "principal components". In one sentence: PCA does not delete variables, it swaps in a smarter set of coordinate axes —
the first new axis carries as much information as possible, so high-dimensional data can be approximated by just a few axes.
1 红箭头永远咬住点云的长轴 The red arrow always locks onto the long axis
PC1 = 方差最大方向2 两根轴各分到多少信息(碎石图) How much each axis carries (scree plot)
点云越扁长,PC1 这根条越高 —— 意味着只用一根轴就能解释绝大部分方差,扔掉 PC2 也几乎不亏。这就是降维的底气。 The flatter and longer the cloud, the taller the PC1 bar — meaning a single axis explains nearly all the variance and dropping PC2 costs almost nothing. That is what makes dimensionality reduction work.
3 现实里的主成分分析 PCA in the Real World
多指标降维:几十个高度相关的过程参数,PCA 压成两三个综合因子,监控图一眼看全局。
Multi-metric reduction: dozens of highly correlated process parameters get compressed into two or three composite factors — one control chart now shows the whole picture.
人脸识别:经典的"特征脸(Eigenfaces)"就是对人脸图像做 PCA,用少数主成分重建并比对。
Face recognition: the classic "Eigenfaces" technique runs PCA on face images and reconstructs & matches them with just a handful of principal components.
质量因子提取:多个传感器读数共线时,PCA 抽出潜在的"真实变化因子",剔除冗余噪声。
Latent-factor extraction: when multiple sensors are collinear, PCA pulls out the underlying "true driver" and strips away redundant noise.
高维可视化:把上百维数据投到前两个主成分平面上,让人类肉眼看见聚类与离群。
High-dimensional visualisation: project hundreds of dimensions onto the first two principal components and human eyes can finally see clusters and outliers.
一句话In One Line
数据里若变量彼此相关,信息就挤在某几个方向上,其余方向几乎是噪声。PCA 通过协方差矩阵的特征向量找到这些主方向,
特征值就是各方向的方差大小。前几个主成分扛走大头,后面的可以安全丢弃 —— 这就是降维既能省算力、又能去噪、还能可视化的根本原因。
记住:PCA 是无监督的纯几何变换,它只关心"方差在哪最大",不关心你的标签或预测目标。
When variables are correlated, the information crowds into a few directions and the rest is mostly noise. PCA uses the eigenvectors of the covariance matrix to find those directions,
and the eigenvalues tell you how much variance each one carries. The first few components carry the load; the rest can be safely dropped — that is why PCA saves compute, denoises, and unlocks visualisation in one move.
Remember: PCA is an unsupervised, purely geometric transformation. It cares only where the variance is largest — never about your label or prediction target.
常见误用Common Mistakes
不标准化就上 PCA。量纲不同(如米和毫克)会让大数值变量霸占主成分,先做标准化(Z 分数)。
Running PCA on raw, un-standardised data. Mixed units (e.g. metres and milligrams) let large-scale variables dominate the components — standardise to Z-scores first.
以为主成分一定有物理含义。主成分是变量的线性组合,可解释但未必对应真实因子,别强行命名。
Assuming each principal component has a real physical meaning. Components are linear combinations of variables — sometimes interpretable, but don't force a label onto them.
方差大就等于重要。PCA 按方差排序,但对预测最有用的信息有时藏在小方差方向里,分类任务慎用。
Treating "more variance" as "more important". PCA ranks by variance, but the most predictive information sometimes hides in a low-variance direction — use it with care for classification.