# 归一化（统计学）

统计学中的**归一化**涵盖若干相互关联的操作，它们将数值置于共同的基础之上：把特征缩放到固定范围、将其标准化为零均值和单位方差、将单个样本重新缩放为单位长度、将数据变换为接近正态分布，以及在概率论中处理位置–尺度分布族。其共同目的是防止数值较大的特征在使用距离度量、基于梯度的优化或正则化的算法中主导学习过程<sup>[1](https://openreview.net/pdf?id=x3l0fQubOn)</sup>。未缩放的数据还可能减慢甚至阻碍许多基于梯度的估计器的收敛<sup>[2](https://scikit-learn.org/stable/auto_examples/preprocessing/plot_all_scaling.html)</sup>。

| 关键事实 | 详情 |
|---|---|
| Z 分数公式 | \( x' = (x - \mu)/\sigma \)；Z 分数表示一个数值偏离均值多少个标准差<sup>[3](https://developers.google.com/machine-learning/crash-course/numerical-data/normalization)</sup> |
| 最小–最大公式 | \( x' = (x - x_{\min})/(x_{\max} - x_{\min}) \)，映射到标准范围，通常为 0 到 1 或 −1 到 +1<sup>[3](https://developers.google.com/machine-learning/crash-course/numerical-data/normalization)</sup> |
| 离群值行为 | 最小–最大缩放将加州房价数据集中平均居住人数特征的所有内点压缩到 [0, 0.005]；基于百分位数的 RobustScaler 则将大多数数值保持在 [−2, 3] 内<sup>[2](https://scikit-learn.org/stable/auto_examples/preprocessing/plot_all_scaling.html)</sup> |
| 不变性 | 标准分数是无量纲的，且在任何位置–尺度变换下保持不变<sup>[4](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/05%3A_Special_Distributions/5.01%3A_Location-Scale_Families)</sup> |
| 变换注意事项 | 应用幂变换并不保证变换后的特征服从正态分布<sup>[5](https://link.springer.com/article/10.1007/s10994-026-06994-3)</sup> |
| 深度学习成本 | 用 RMSNorm 替代 LayerNorm 可节省 7%–64% 的训练和推理时间<sup>[6](https://proceedings.neurips.cc/paper_files/paper/2023/file/8f1bacee31caf990a4f08d84f0ccb322-Paper-Conference.pdf)</sup> |
| 泄漏规则 | 在训练集上确定的缩放因子必须原样应用于测试集；分别确定因子会产生错误的测试集<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC11080237/)</sup> |

## 定义与核心方法

**Z 分数标准化。** 在通常的机器学习意义上，标准化是指通过去除均值来对每个特征进行中心化，并通过除以标准差来缩放非常数特征，通常忽略分布的形状<sup>[8](https://scikit-learn.org/stable/modules/preprocessing.html)</sup>。谷歌的机器学习课程建议对近似正态分布、峰值接近均值的特征使用该方法<sup>[3](https://developers.google.com/machine-learning/crash-course/numerical-data/normalization)</sup>。

**最小–最大缩放。** 线性缩放将数值从其自然范围转换到标准范围，通常为 0 到 1 或 −1 到 +1，适用于在其范围内大致均匀分布的特征<sup>[3](https://developers.google.com/machine-learning/crash-course/numerical-data/normalization)</sup>。在加州房价数据集上，最小–最大缩放将平均居住人数特征的所有值映射到 [0, 1]，但将所有内点压缩到狭窄的 [0, 0.005] 范围内；它并不减弱离群值的影响，而是将其线性缩放到固定范围内<sup>[2](https://scikit-learn.org/stable/auto_examples/preprocessing/plot_all_scaling.html)</sup>。

**逐样本归一化。** 在 scikit-learn 的术语中，归一化指将单个样本缩放到单位范数，这对点积或核等二次型很有用<sup>[8](https://scikit-learn.org/stable/modules/preprocessing.html)</sup>。Normalizer 独立于样本分布对每个样本向量重新缩放，因此它按样本而非按特征操作<sup>[2](https://scikit-learn.org/stable/auto_examples/preprocessing/plot_all_scaling.html)</sup>。

**稳健缩放。** 当数据包含大量离群值时，使用均值和方差进行缩放很可能效果不佳，RobustScaler 是一种可直接替换的方案<sup>[8](https://scikit-learn.org/stable/modules/preprocessing.html)</sup>。其中心化和缩放统计量基于百分位数，因此不受少量极大边缘离群值的影响；在加州房价示例中，两个特征的大多数变换值都落在 [−2, 3] 内<sup>[2](https://scikit-learn.org/stable/auto_examples/preprocessing/plot_all_scaling.html)</sup>。

## 归一化与概率分布

标准化的统计学基础是位置–尺度族。对于 \( a \in \mathbb{R} \) 和 \( b \in (0, \infty) \)，随机变量 \( X = a + b \, Z \) 生成一个双参数分布族，其中 \( a \) 为位置参数，\( b \) 为尺度参数；\( b = 1 \) 给出位置族，\( a = 0 \) 给出尺度族<sup>[4](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/05%3A_Special_Distributions/5.01%3A_Location-Scale_Families)</sup>。这些变换自然产生于单位换算：从米到英寸的转换是尺度变换，华氏度到摄氏度等温度转换则是位置–尺度变换<sup>[4](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/05%3A_Special_Distributions/5.01%3A_Location-Scale_Families)</sup>。

标准分数通过减去均值并除以标准差得到，它是无量纲的，以标准差为单位度量偏离均值的距离；\( X \) 和 \( Z \) 的标准分数相同，因此 z 分数在任何位置–尺度变化下不变<sup>[4](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/05%3A_Special_Distributions/5.01%3A_Location-Scale_Families)</sup>。这就是为什么以美元表示的特征和以千美元表示的同一特征会产生相同的标准化值。

## 面向正态性的变换

特征缩放改变位置和尺度；另一类方法改变分布的形状。NIST 工程统计手册直截了当地指出了动机：非正态性是生活的常态，因为身高或体重等特征没有一个是精确服从正态分布的，而变换是使非正态数据接近正态数据的标准策略；实际困难在于选择使用哪种变换<sup>[9](https://www.itl.nist.gov/div898/handbook/pmc/section5/pmc52.htm)</sup>。

**幂变换。** Box–Cox 变换由 G. E. P. Box 和 D. R. Cox 在 1964 年发表于《皇家统计学会杂志 B 辑》的论文《变换分析》中提出，它假定响应变量独立地服从正态分布，具有恒定方差，期望值由对参数呈线性的模型给出，同时放宽了数据本身已经正态的假设<sup>[10](https://academic.oup.com/jrsssb/article/26/2/211/7028064?login=false)</sup>。《统计科学》2021 年的一篇综述回顾了 Box–Cox 族及其扩展，包括参数幂变换与基于非参数平滑的变换之间的比较<sup>[11](https://researchonline.lse.ac.uk/id/eprint/103537/1/StatSciV4.pdf)</sup>。在软件中，PowerTransformer 实现 Yeo–Johnson 和 Box–Cox 变换，最优缩放因子由最大似然确定；Box–Cox 要求数据严格为正，否则优选 Yeo–Johnson<sup>[2](https://scikit-learn.org/stable/auto_examples/preprocessing/plot_all_scaling.html)</sup>。

**敏感性与局限。** Box–Cox 和 Yeo–Johnson 参数的最大似然估计对离群值非常敏感，以至于单个离群值就能对估计产生任意大的影响<sup>[12](https://link.springer.com/article/10.1007/s10994-021-05960-5)</sup>。这两种变换还对数据的位置和尺度敏感；稳健变体同时优化变换参数 \( \lambda \)、偏移参数 \( x_0 \) 和尺度参数 \( s \)<sup>[5](https://link.springer.com/article/10.1007/s10994-026-06994-3)</sup>。未变换数据中的离群值在变换后未必仍是离群值，反之亦然，因此在拟合 Yeo–Johnson 变换时最好预先对数据集进行标准化<sup>[12](https://link.springer.com/article/10.1007/s10994-021-05960-5)</sup>。

一个反复出现的警告是，应用幂变换并不保证变换后的特征服从正态分布；取决于位置、尺度和离群值，它甚至可能降低正态性，而较大的 \( |\lambda| \) 可能导致数值问题<sup>[5](https://link.springer.com/article/10.1007/s10994-026-06994-3)</sup>。一种应对策略是追求中心正态性，即变换后的数据在中心附近接近正态，但可能有一些离群值例外<sup>[12](https://link.springer.com/article/10.1007/s10994-021-05960-5)</sup>。在谷歌课程的实用分类中，对数缩放是处理至少一侧尾部严重偏斜的特征的工具<sup>[3](https://developers.google.com/machine-learning/crash-course/numerical-data/normalization)</sup>。

## 数据说话

加州房价示例量化了不同缩放器在同一数据上的行为差异。经 StandardScaler 处理后，变换后的收入中位数特征的大多数数据落在 [−2, 4] 内，而变换后的平均居住人数特征则落在 [−0.2, 0.2] 内，表明即使经过标准化，离群值仍会使特征尺度失衡<sup>[2](https://scikit-learn.org/stable/auto_examples/preprocessing/plot_all_scaling.html)</sup>。

对于流水线中的变换，一项涵盖 231 个数值特征数据集的机器学习实验发现，将稳健的位置和尺度不变的幂变换集成到自动化流水线中，与常规变体相比，对模型性能没有产生有意义的改善或损害<sup>[5](https://link.springer.com/article/10.1007/s10994-026-06994-3)</sup>。

## 与标准化、缩放及稳健替代方案的比较

这些方法在目标和失效模式上各不相同。标准化针对均值和方差，忽略分布形状；最小–最大针对固定范围，受极值摆布；稳健缩放针对百分位数；分位数变换和幂变换针对分布形状<sup>[8](https://scikit-learn.org/stable/modules/preprocessing.html)</sup><sup> • </sup><sup>[2](https://scikit-learn.org/stable/auto_examples/preprocessing/plot_all_scaling.html)</sup>。QuantileTransformer 将所有数据（包括离群值）映射到均匀的 [0, 1] 分布，将离群值压缩到范围边界，这会对极端值产生饱和伪影<sup>[2](https://scikit-learn.org/stable/auto_examples/preprocessing/plot_all_scaling.html)</sup>。代价是结构性的：分位数变换扭曲了特征内部和特征之间的相关性与距离<sup>[8](https://scikit-learn.org/stable/modules/preprocessing.html)</sup>，尽管其完美高斯分布的输出空间非常小，但变换到高斯分布未必导致信息损失，因为高斯化流可以将连续分布变换为高斯分布，同时允许高效的反演<sup>[1](https://openreview.net/pdf?id=x3l0fQubOn)</sup><sup> • </sup><sup>[22](https://proceedings.mlr.press/v108/meng20b.html)</sup>。

在基因组学中，分位数归一化是一种全局调整，强制各样本的统计分布相同，假定全局分布差异由技术变异引起，并使用各样本每个分位数的平均值作为参考<sup>[13](https://academic.oup.com/biostatistics/article/19/2/185/3949169)</sup>。其目的是消除或最小化技术变异性，除此之外，常用技术还包括线性（最小–最大）缩放、Z 归一化和秩缩放<sup>[14](https://www.nature.com/articles/s41598-020-72664-6)</sup>。在 mRNA-Seq 差异表达中，基于分位数的流程与 qRT-PCR 的一致性远优于按泳道总量缩放基因计数的常规做法<sup>[15](https://pmc.ncbi.nlm.nih.gov/articles/PMC2838869/)</sup>。

## 实践与陷阱

**训练/测试泄漏。** 缩放器的参数是模型的一部分。StandardScaler 在训练集上计算均值和标准差，以便将相同的变换重新应用于测试集，这使其适合作为流水线的早期步骤<sup>[8](https://scikit-learn.org/stable/modules/preprocessing.html)</sup>。2024 年一项对 RNA-Seq 预处理流水线的比较直接陈述了规则：为训练集确定的缩放因子也应用于测试集，因为分别为两个数据集确定缩放因子会为下游分析生成错误的测试集<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC11080237/)</sup>。

**解释与流水线。** 归一化直接影响基于梯度的优化、基于距离的度量和正则化，不同技术适合不同的模型和分布；推荐的搭配包括对有界于 [0, 1] 的特征使用 MinMaxScaler，对非线性偏斜分布使用对数、Box–Cox 或 Yeo–Johnson 变换<sup>[16](https://www.khoury.northeastern.edu/home/vip/teach/MLcourse/1_intro_DT_RULES_REG/data_normalization/normalization_when_to_use_what.pdf)</sup>。即使网络包含内部批归一化或层归一化，输入归一化仍然有用：均值接近零、具有单位方差的数据可以加速收敛并有助于防止早期层的饱和<sup>[16](https://www.khoury.northeastern.edu/home/vip/teach/MLcourse/1_intro_DT_RULES_REG/data_normalization/normalization_when_to_use_what.pdf)</sup>。

## 最新进展

**RMSNorm 与 LayerNorm。** 层归一化独立地归一化每个隐藏向量（通常在任何学习到的仿射变换之前归一化为零均值和单位方差），这与在训练期间使用批统计量的批归一化不同，对变长长序列尤其有效<sup>[17](https://aclanthology.org/2026.findings-eacl.20.pdf)</sup>。RMSNorm 通过向量的均方根值重新缩放向量而不重新中心化；用 RMSNorm 替代 LayerNorm 可以实现相当的性能，并节省 7%–64% 的训练和推理时间<sup>[6](https://proceedings.neurips.cc/paper_files/paper/2023/file/8f1bacee31caf990a4f08d84f0ccb322-Paper-Conference.pdf)</sup>。NeurIPS 2023 的一篇论文正式确立了 Pre-LN、Pre-RMSNorm 和 Pre-CRMSNorm Transformer 变体在训练和推理中的等价性，Pre-LN Transformer 的训练和推理时间减少了 1%–10%<sup>[6](https://proceedings.neurips.cc/paper_files/paper/2023/file/8f1bacee31caf990a4f08d84f0ccb322-Paper-Conference.pdf)</sup>。从几何上看，LayerNorm 去除向量沿全一方向的分量，对结果进行归一化，并乘以 \( \sqrt{d} \) 进行缩放，被去除的信息不可逆地丢失<sup>[17](https://aclanthology.org/2026.findings-eacl.20.pdf)</sup>。

**更新的变体。** 在 NeurIPS 2025 上提出的 HybridNorm 结合了 RMSNorm 等归一化方案，在某些 Transformer 训练设置中作为更有效的替代方案<sup>[18](https://proceedings.neurips.cc/paper_files/paper/2025/file/23a1e7765b22c7e2ffdabf2e6b5dbc44-Paper-Conference.pdf)</sup>。2026 年的一项分析定义了“可折叠”LayerNorm，并表明广泛使用的架构中的许多 LayerNorm 允许在推理时精确转换为 RMSNorm，从而实现 2% 或更多的端到端加速<sup>[19](https://arxiv.org/abs/2605.14521)</sup>。

**综述与表格数据实践。** 2026 年一项遵循 PRISMA 2020 指南、对 2013 年至 2026 年间发表的 46 项研究进行的系统综述发现，批归一化是在时间序列数据上训练深度网络最常用的技术，可能是因为它提高了训练稳定性并加速了收敛<sup>[20](https://dl.acm.org/doi/abs/10.1016/j.neucom.2026.134095)</sup>。同一综述提出了一种自适应顺序（adapt-seq）层，先应用 z 分数归一化，再进行自适应最小–最大缩放；在金融（限价订单簿）和医疗（心力衰竭）时间序列数据集上，使用 MLP 和 LSTM 模型，adapt-seq 在所有报告的指标上（包括准确率、精确率、召回率和 F1 分数）均优于批归一化和无归一化<sup>[20](https://dl.acm.org/doi/abs/10.1016/j.neucom.2026.134095)</sup>。在表格数据方面，Fast-SQN——一种可微的结构分位数归一化——在加州房价数据集上用作预处理时，在 RMSE、MAE 和 MdAE 上优于经典和有序分位数归一化以及 Box–Cox 和 Yeo–Johnson 变换<sup>[1](https://openreview.net/pdf?id=x3l0fQubOn)</sup>。一个相关的研究方向——正态性归一化——在训练期间使用带加性高斯噪声的幂变换来鼓励神经网络特征表示的正态性<sup>[21](https://dl.acm.org/doi/10.5555/3780338.3780916)</sup>。

## References

1. [Structural Quantile Normalization (SQN), conference paper, OpenReview](https://openreview.net/pdf?id=x3l0fQubOn)
2. [Compare the effect of different scalers on data with outliers, scikit-learn example](https://scikit-learn.org/stable/auto_examples/preprocessing/plot_all_scaling.html)
3. [Numerical data: Normalization, Google for Developers Machine Learning Crash Course](https://developers.google.com/machine-learning/crash-course/numerical-data/normalization)
4. [Location-Scale Families, Statistics LibreTexts (Siegrist)](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/05%3A_Special_Distributions/5.01%3A_Location-Scale_Families)
5. [Location- and Scale-Invariant Power Transformations for Transforming Data to Normality. Machine Learning (Springer).](https://link.springer.com/article/10.1007/s10994-026-06994-3)
6. [Pre-RMSNorm and Pre-CRMSNorm Transformers: Equivalent and Efficient Pre-LN Transformers. NeurIPS 2023.](https://proceedings.neurips.cc/paper_files/paper/2023/file/8f1bacee31caf990a4f08d84f0ccb322-Paper-Conference.pdf)
7. [A comparison of RNA-Seq data preprocessing pipelines for transcriptomic predictions across independent studies (2024).](https://pmc.ncbi.nlm.nih.gov/articles/PMC11080237/)
8. [8.3. Preprocessing data, scikit-learn documentation](https://scikit-learn.org/stable/modules/preprocessing.html)
9. [What do we do when data are non-normal, NIST/SEMATECH e-Handbook](https://www.itl.nist.gov/div898/handbook/pmc/section5/pmc52.htm)
10. [Box, G. E. P., and Cox, D. R. (1964). An Analysis of Transformations. JRSS-B 26(2):211.](https://academic.oup.com/jrsssb/article/26/2/211/7028064?login=false)
11. [Atkinson, A., Riani, M., and Corbellini, A. (2021). The Box–Cox Transformation: Review and Extensions. Statistical Science 36(2):239–255.](https://researchonline.lse.ac.uk/id/eprint/103537/1/StatSciV4.pdf)
12. [Transforming Variables to Central Normality. Machine Learning (Springer, 2021).](https://link.springer.com/article/10.1007/s10994-021-05960-5)
13. [Smooth quantile normalization. Biostatistics (Oxford Academic).](https://academic.oup.com/biostatistics/article/19/2/185/3949169)
14. [How to do quantile normalization correctly for gene expression data analyses. Scientific Reports (2020).](https://www.nature.com/articles/s41598-020-72664-6)
15. [Evaluation of statistical methods for normalization and differential expression in mRNA-Seq experiments. Genome Biology.](https://pmc.ncbi.nlm.nih.gov/articles/PMC2838869/)
16. [Normalization in Machine Learning: When to Use What, Northeastern University Khoury College course notes](https://www.khoury.northeastern.edu/home/vip/teach/MLcourse/1_intro_DT_RULES_REG/data_normalization/normalization_when_to_use_what.pdf)
17. [Geometric Interpretation of Layer Normalization and a Comparative Analysis with RMSNorm. EACL 2026 Findings.](https://aclanthology.org/2026.findings-eacl.20.pdf)
18. [HybridNorm: Towards Stable and Efficient Transformer Training via Hybrid Normalization. NeurIPS 2025.](https://proceedings.neurips.cc/paper_files/paper/2025/file/23a1e7765b22c7e2ffdabf2e6b5dbc44-Paper-Conference.pdf)
19. [Enjoy Your Layer Normalization with the Computational Efficiency of RMSNorm. arXiv preprint.](https://arxiv.org/abs/2605.14521)
20. [A systematic literature review and taxonomy of normalization techniques in training DNNs for time-series data. Neurocomputing (2026).](https://dl.acm.org/doi/abs/10.1016/j.neucom.2026.134095)
21. [On the importance of Gaussianizing representations. ICML.](https://dl.acm.org/doi/10.5555/3780338.3780916)
22. [Gaussianization Flows](https://proceedings.mlr.press/v108/meng20b.html)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 19, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Sep 19, 2026; Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Probability theory › Probability distributions › Distribution families and classification › Location–scale and shape parameterization

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/normalization-statistics

English original: https://www.edgepedia.org/normalization-statistics
