# 过采样（机器学习）

过采样是一种面向不平衡分类的数据层面技术，它通过复制已有样本或生成新的合成样本，增加训练集中少数类样本的数量。它针对的是学习算法在某一类别严重缺乏代表时表现不佳的问题。<sup>[1](https://dl.acm.org/doi/10.1109/TKDE.2008.239)</sup> 最著名的过采样方法是合成少数类过采样技术（SMOTE），它生成合成样本，而不是有放回地过采样，通常与对多数类的欠采样结合使用。<sup>[2](https://doi.org/10.1613/jair.953)</sup> 重采样综述将这种合成方法与随机过采样（ROS）区分开来，后者对相同样本进行迭代复制，会通过非常具体的决策区域助长过拟合。<sup>[3](https://link.springer.com/article/10.1186/s40537-025-01119-4)</sup>

| 关键事实 | 详情 |
|---|---|
| 引入论文 | SMOTE，作者 N. V. Chawla、K. W. Bowyer、L. O. Hall 和 W. P. Kegelmeyer，《人工智能研究杂志》16:321–357，2002 年<sup>[2](https://doi.org/10.1613/jair.953)</sup> |
| 核心机制 | 在少数类样本与其最近邻之间插值：\( x_{\mathrm{new}} = x_i + \lambda \cdot (x_{zi} - x_i) \)，其中 \( \lambda \) 在 [0, 1] 内随机取值<sup>[4](https://imbalanced-learn.org/stable/over_sampling.html)</sup> |
| 默认邻域 | 原始实现和 imbalanced-learn 中均为五个最近邻<sup>[2](https://doi.org/10.1613/jair.953)</sup><sup> • </sup><sup>[5](https://imbalanced-learn.org/stable/references/generated/imblearn.over_sampling.SMOTE.html?highlight=smote)</sup> |
| 原始评估 | C4.5、Ripper 和朴素贝叶斯；SMOTE 分类器在 48 次实验中的 44 次表现最佳<sup>[2](https://doi.org/10.1613/jair.953)</sup> |
| 典型不平衡比例 | 欺诈检测中普遍存在 100 比 1；其他应用中据报道高达 100,000 比 1<sup>[2](https://doi.org/10.1613/jair.953)</sup> |
| 基准差异 | 104 个数据集上的 85 种过采样变体；表现最佳者（DBSMOTE）平均仅以 0.01 AUC 胜过 SMOTE<sup>[6](https://doi.org/10.1016/j.asoc.2019.105662)</sup> |
| 主要工具 | imbalanced-learn（Python），默认 `sampling_strategy='auto'` 和 `k_neighbors=5`<sup>[7](https://doi.org/10.48550/arxiv.1609.06570)</sup><sup> • </sup><sup>[5](https://imbalanced-learn.org/stable/references/generated/imblearn.over_sampling.SMOTE.html?highlight=smote)</sup> |

## 工作原理

过采样只改变训练集：它增加少数类样本，使学习器看到更平衡的类别分布，从而扭转 [SMOTE](https://www.edgepedia.org/zh/smote) 作者所称的学习器对多数类的初始偏向。<sup>[2](https://doi.org/10.1613/jair.953)</sup> 存在两种机制。随机过采样复制已有的少数类样本；通过复制，产生少数类分类的决策区域会随着样本被复制而变得更小、更具体，这与期望效果相反。<sup>[2](https://doi.org/10.1613/jair.953)</sup> 合成生成则是在真实样本之间创建新样本点。

SMOTE 的规则是：取一个少数类特征向量与其少数类最近邻之一之间的差值，乘以 0 到 1 之间的随机数，再将结果加到原始向量上，从而在两个样本连成的线段上随机选取一点。<sup>[2](https://doi.org/10.1613/jair.953)</sup> 用 imbalanced-learn 的记号表示，

\[ x_{\mathrm{new}} = x_i + \lambda \cdot (x_{zi} - x_i), \qquad \lambda \in [0, 1] \]

其中 \( x_{zi} \) 是随机选定的邻居。<sup>[4](https://imbalanced-learn.org/stable/over_sampling.html)</sup> 原始实现使用五个最近邻；对于 200% 的过采样，从五个中选取两个，并在每个方向上生成一个样本。<sup>[2](https://doi.org/10.1613/jair.953)</sup>

## 如何操作

实践者设定目标类别比例，拟合重采样器，并在重采样后的数据上训练分类器。在 imbalanced-learn 中，SMOTE 采用 `sampling_strategy='auto'`（等价于 'not majority'：对所有类别重采样，但多数类除外）和 `k_neighbors=5`，并按照 2002 年论文提出的“一对多”方案支持多类重采样。<sup>[5](https://imbalanced-learn.org/stable/references/generated/imblearn.over_sampling.SMOTE.html?highlight=smote)</sup> RandomOverSampler 复制已有样本；其 `shrinkage` 参数启用一种称为随机过采样样本（ROSE）的平滑自助法。<sup>[4](https://imbalanced-learn.org/stable/over_sampling.html)</sup> 原始论文建议将 SMOTE 与对多数类的随机欠采样结合，在 imbalanced-learn 中通过在 Pipeline 中串联 SMOTE 和 RandomUnderSampler 实现。<sup>[8](https://machinelearningmastery.com/smote-oversampling-for-imbalanced-classification/)</sup>

重采样必须在交叉验证循环内部进行：在 k 折交叉验证中，正确的做法是仅在训练数据上拟合重采样器，并在分层但未变换的测试折上评估；在训练/测试划分之前进行过采样会泄露信息。

## 起源

SMOTE 由 N. V. Chawla、K. W. Bowyer、L. O. Hall 和 W. P. Kegelmeyer 于 2002 年在《人工智能研究杂志》上报告。<sup>[2](https://doi.org/10.1613/jair.953)</sup> Chawla 将这一想法追溯到 2000 年他作为研究生处理的乳腺钼靶问题，当时一棵决策树达到约 97% 的准确率，而猜测多数类本可达到 97.68%。<sup>[9](https://doi.org/10.1613/jair.1.11192)</sup> 该方法受到一项在手写字符识别中已被证明成功的技术启发（Ha & Bunke，1997），该技术通过旋转和倾斜等操作创建额外训练数据。<sup>[2](https://doi.org/10.1613/jair.953)</sup>

论文提及的早期重采样工作包括 Kubat 和 Matwin 1997 年的单边选择欠采样，该方法使用 Tomek Links 识别噪声和边界样本<sup>[10](https://people.iee.ihu.gr/~stoug/odep/papers/DATA%20MINING%20FOR%20IMBALANCED%20DATASETS:%20AN%20OVERVIEW.pdf)</sup>，以及 Japkowicz、Lewis 和 Catlett、Ling 和 Li 的工作，还有 Pazzani 及其同事与 Domingos 的成本敏感方法。<sup>[2](https://doi.org/10.1613/jair.953)</sup>

## 变体

根据 2020 年的一项统计，已有 90 多种 SMOTE 扩展发表在期刊和会议上<sup>[11](https://pmc.ncbi.nlm.nih.gov/articles/PMC7206329/)</sup>；另一项基准统计到 100 多种变体。<sup>[6](https://doi.org/10.1016/j.asoc.2019.105662)</sup>

**边界变体。** Borderline-SMOTE 只对类别边界附近的少数类样本过采样，根据多数类邻居的比例将样本分类为安全、危险或噪声；Borderline-SMOTE1 在危险样本与同类邻居之间插值，而 Borderline-SMOTE2 还使用最近的多数类邻居。<sup>[12](https://sci2s.ugr.es/keel/pdf/specific/congreso/han%5Fborderline%5Fsmote.pdf)</sup><sup> • </sup><sup>[3](https://link.springer.com/article/10.1186/s40537-025-01119-4)</sup> SVM-SMOTE 由 Hien M. Nguyen、Eric W. Cooper 和 Katsuari Kamei 于 2011 年报告，它应用支持向量机并在少数类支持向量上插值。<sup>[13](https://doi.org/10.1504/ijkesdp.2011.039875)</sup>

**自适应和基于密度的变体。** ADASYN 在 k-NN 分类器错误分类的原始样本旁生成样本，而基本 SMOTE 不区分简单样本和困难样本。<sup>[4](https://imbalanced-learn.org/stable/over_sampling.html)</sup> DBSMOTE 使用基于密度的聚类。<sup>[14](https://doi.org/10.1007/s10489-011-0287-y)</sup>

**混合数据与混合方法。** 2002 年论文中引入的 SMOTE-NC 通过将少数类连续特征标准差的中位数加入距离计算来处理名义特征。<sup>[2](https://doi.org/10.1613/jair.953)</sup> 混合方法将过采样与过滤或欠采样结合：SMOTE-IPF 加入迭代分区过滤<sup>[15](https://doi.org/10.1016/j.ins.2014.08.051)</sup>，SMOTE-RSB* 使用粗糙集<sup>[16](https://doi.org/10.1007/s10115-011-0465-6)</sup>，DeepSMOTE 将深度学习与 SMOTE 融合。<sup>[17](https://doi.org/10.1109/tnnls.2021.3136503)</sup>

**生成式过采样。** Justin Engelmann 和 Stefan Lessmann 于 2021 年报告了基于条件 Wasserstein GAN 的表格数据过采样。<sup>[18](https://doi.org/10.1016/j.eswa.2021.114582)</sup> LITO 通过逐步掩蔽多数类样本的重要特征并将其向少数类分布插补来合成少数类样本，然后用同一语言模型对标签进行自认证。<sup>[19](https://proceedings.iclr.cc/paper_files/paper/2024/file/5d54d2df6ec8f7b920aa0fec9a6d1b2e-Paper-Conference.pdf)</sup>

## 应用

100 比 1 量级的不平衡在欺诈检测中普遍存在，其他应用中据报道存在高达 100,000 比 1 的不平衡。<sup>[2](https://doi.org/10.1613/jair.953)</sup> [医学诊断](https://www.edgepedia.org/zh/medical-diagnosis)是促成这一方法的应用场景：SMOTE 背后的乳腺钼靶问题涉及预测癌变像素。<sup>[9](https://doi.org/10.1613/jair.1.11192)</sup> Solberg 和 Solberg（1996）处理了 SAR 图像中不平衡的油膜分类问题，其中相似物的先验概率为 0.98。<sup>[2](https://doi.org/10.1613/jair.953)</sup>

## 局限与替代方法

**失效模式。** SMOTE 的均匀随机样本选择可能膨胀密集区域、放大噪声，并因忽略多数类结构而导致类别重叠。<sup>[3](https://link.springer.com/article/10.1186/s40537-025-01119-4)</sup> 相关问题包括过度泛化问题，即本应属于少数类域的合成样本进入多数类域，在复杂数据环境中更为严重<sup>[20](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0288540)</sup>，以及对噪声样本的过采样。<sup>[3](https://link.springer.com/article/10.1186/s40537-025-01119-4)</sup> 表现最佳的技术在极端情况下也会失败，例如少数类样本极少（5 到 10 个）且属性多于实例时。<sup>[6](https://doi.org/10.1016/j.asoc.2019.105662)</sup>

**它有帮助吗？已发表证据存在矛盾。** 原始论文报告 SMOTE 分类器在 C4.5、Ripper 和朴素贝叶斯的 48 次实验中有 44 次表现最佳。<sup>[2](https://doi.org/10.1613/jair.953)</sup> 与此相对，一项在 31 个数据集上对 56 种采样方法与分类器组合的基准发现，采样仅在 12.2% 的情况下显著改变性能（配对 t 检验，\( P < 0.05 \)）——以 AUPRC（分类器的精确率-召回率性能指标）衡量——以 AUROC 衡量则为 10.0%，且更可能降低而非提升性能；按 AUPRC 衡量，31 个数据集中有 29 个的最优分类器不需要采样。<sup>[21](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0271260)</sup> 85 变体基准发现，顶级高级过采样器在 AUC 和 F1 上比普通 SMOTE 高出约 1%，在 G 上高出 2%，在 P20 上高出 0.25%，表现最佳者 DBSMOTE 在 104 个数据集上平均比 SMOTE 提升 0.01 AUC。<sup>[6](https://doi.org/10.1016/j.asoc.2019.105662)</sup>

**替代方法。** 在非复杂数据集中，欠采样被发现是最优的；而在复杂数据集中，应用过滤方法删除错分样本是最优的；SMOTE-TomekLinks 和 SMOTE-ENN 是最典型的过滤组合，其动机是 SMOTE 生成噪声样本的缺点。<sup>[20](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0288540)</sup> 在 [PLOS One](https://www.edgepedia.org/zh/plos-one) 基准中，随机过采样和 SMOTE 是表现最佳的采样方法，而欠采样更常降低性能。<sup>[21](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0271260)</sup>

## References

1. [Learning from Imbalanced Data (He & Garcia, IEEE TKDE)](https://dl.acm.org/doi/10.1109/TKDE.2008.239)
2. [N. V. Chawla and colleagues (2002). SMOTE: Synthetic Minority Over-sampling Technique. Journal of Artificial Intelligence Research.](https://doi.org/10.1613/jair.953)
3. [Resampling approaches to handle class imbalance: a review from a data perspective (Journal of Big Data, 2025)](https://link.springer.com/article/10.1186/s40537-025-01119-4)
4. [imbalanced-learn User Guide: Over-sampling (Version 0.14.2)](https://imbalanced-learn.org/stable/over_sampling.html)
5. [imblearn.over_sampling.SMOTE API reference (Version 0.14.2)](https://imbalanced-learn.org/stable/references/generated/imblearn.over_sampling.SMOTE.html?highlight=smote)
6. [György Kovács (2019). An empirical comparison and evaluation of minority oversampling techniques on a large number of imbalanced datasets. Applied Soft Computing.](https://doi.org/10.1016/j.asoc.2019.105662)
7. [Lemaitre, Guillaume, Nogueira, Fernando, Aridas, Christos K. (2016). Imbalanced-learn: A Python Toolbox to Tackle the Curse of Imbalanced Datasets in Machine Learning. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1609.06570)
8. [SMOTE for Imbalanced Classification with Python (MachineLearningMastery)](https://machinelearningmastery.com/smote-oversampling-for-imbalanced-classification/)
9. [Alberto Fernandez and colleagues (2018). SMOTE for Learning from Imbalanced Data: Progress and Challenges, Marking the 15-year Anniversary. Journal of Artificial Intelligence Research.](https://doi.org/10.1613/jair.1.11192)
10. [Data Mining for Imbalanced Datasets: An Overview (Chawla, Data Mining and Knowledge Discovery Handbook)](https://people.iee.ihu.gr/~stoug/odep/papers/DATA%20MINING%20FOR%20IMBALANCED%20DATASETS:%20AN%20OVERVIEW.pdf)
11. [On the Performance of Oversampling Techniques for Class Imbalance Problems](https://pmc.ncbi.nlm.nih.gov/articles/PMC7206329/)
12. [Borderline-SMOTE: A New Over-Sampling Method in Imbalanced Data Sets Learning (Han, Wang, Mao, 2005)](https://sci2s.ugr.es/keel/pdf/specific/congreso/han%5Fborderline%5Fsmote.pdf)
13. [Hien M. Nguyen, Eric W. Cooper, Katsuari Kamei (2011). Borderline over-sampling for imbalanced data classification. International Journal of Knowledge Engineering and Soft Data Paradigms.](https://doi.org/10.1504/ijkesdp.2011.039875)
14. [Chumphol Bunkhumpornpat, Krung Sinapiromsaran, Chidchanok Lursinsap (2011). DBSMOTE: Density-Based Synthetic Minority Over-sampling TEchnique. Applied Intelligence.](https://doi.org/10.1007/s10489-011-0287-y)
15. [José A. Sáez and colleagues (2014). SMOTE–IPF: Addressing the noisy and borderline examples problem in imbalanced classification by a re-sampling method with filtering. Information Sciences.](https://doi.org/10.1016/j.ins.2014.08.051)
16. [Enislay Ramentol and colleagues (2011). SMOTE-RSB *: a hybrid preprocessing approach based on oversampling and undersampling for high imbalanced data-sets using SMOTE and rough sets theory. Knowledge and Information Systems.](https://doi.org/10.1007/s10115-011-0465-6)
17. [Damien Dablain, Bartosz Krawczyk, Nitesh V. Chawla (2022). DeepSMOTE: Fusing Deep Learning and SMOTE for Imbalanced Data. IEEE Transactions on Neural Networks and Learning Systems.](https://doi.org/10.1109/tnnls.2021.3136503)
18. [Justin Engelmann, Stefan Lessmann (2021). Conditional Wasserstein GAN-based oversampling of tabular data for imbalanced learning. Expert Systems with Applications.](https://doi.org/10.1016/j.eswa.2021.114582)
19. [LITO: Language-Interfaced Tabular Oversampling (ICLR 2024)](https://proceedings.iclr.cc/paper_files/paper/2024/file/5d54d2df6ec8f7b920aa0fec9a6d1b2e-Paper-Conference.pdf)
20. [Optimal selection of resampling methods for imbalanced data with high complexity (PLOS One)](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0288540)
21. [An empirical evaluation of sampling methods for the classification of imbalanced data (PLOS One)](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0271260)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Machine learning methods › Supervised, unsupervised, and semi-supervised learning › Supervised learning concepts

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/oversampling-machine-learning

English original: https://www.edgepedia.org/oversampling-machine-learning
