# 正例-无标记学习（Positive-unlabeled learning）

正例-无标记（PU）学习是一种机器学习方法，仅用正例和无标记样本训练二分类器，不需要任何有标记负例。当负例数据不可获得、收集成本过高或不可靠时，就会使用它，例如基因-疾病识别、文本分类、垃圾评论检测和异常检测。<sup>[1](https://arxiv.org/abs/1811.04820)</sup><sup> • </sup><sup>[2](https://www.jmlr.org/papers/volume24/22-067/22-067.pdf)</sup> 学习器接收一组有标记正例和一组无标记样本，并假定后者同时包含正例和负例，最终输出一个正例对负例的分类器（或作为中间形式，输出正例对无标记的分类器）。<sup>[1](https://arxiv.org/abs/1811.04820)</sup><sup> • </sup><sup>[3](https://dl.acm.org/doi/abs/10.1145/1401890.1401920)</sup>

| 关键事实 | 细节 |
|---|---|
| 输入 | 有标记正例，加上包含正例与负例未知混合的无标记数据<sup>[1](https://arxiv.org/abs/1811.04820)</sup> |
| 核心假设 | SCAR：有标记样本是正例的均匀子集，p(s=1\|x,y=1)=p(s=1\|y=1)=c<sup>[3](https://dl.acm.org/doi/abs/10.1145/1401890.1401920)</sup> |
| 关键恒等式 | 在 SCAR 下，p(y=1\|x)=p(s=1\|x)/c，因此标准分类器等于非传统分类器除以标记频率 c<sup>[3](https://dl.acm.org/doi/abs/10.1145/1401890.1401920)</sup> |
| 类先验 | 在没有额外假设时，α=Pr(y=1) 无法从 PU 数据中识别<sup>[1](https://arxiv.org/abs/1811.04820)</sup> |
| 代价敏感形式 | 对于满足 \( \ell(m)+\ell(-m)=1 \) 的损失，定义 \( R_{1}=\mathbb{E}_{P_{+}}[\ell(g(X))] \) 和 \( R_{X}=\mathbb{E}_{P_{X}}[\ell(-g(X))] \)，已知先验 π 时给出 \( R(f)=2\pi\cdot R_{1}(f)+R_{X}(f)-\pi \)<sup>[4](https://papers.nips.cc/paper_files/paper/2014/file/f032bc3f1eb547f716df87edb523b8f0-Paper.pdf)</sup> |
| 理论 | 在标记样本与无标记样本数量相等时，泛化误差不劣于全监督学习的 2√2 倍<sup>[4](https://papers.nips.cc/paper_files/paper/2014/file/f032bc3f1eb547f716df87edb523b8f0-Paper.pdf)</sup> |
| 评估注意事项 | 在真实 PU 数据上，精确率、召回率和 F 度量无法正确计算；综述的 51 篇论文中有 42 篇改在人工构造的 PU 数据上评估<sup>[5](https://kdd.org/exploration_files/p5-Evaluating_the_Predictive_Performance_of_Positive-_Unlabelled_Classifiers_a_brief_critical_review_and_practical_recommendations_for_improvement.pdf)</sup> |

## 工作原理

形式上，数据由随机变量 x、y 和 s 描述，其中 y 是真实类别，s 表示是否被标记，并且只有正例会被标记，因此 p(s=1|x,y=0)=0。<sup>[3](https://dl.acm.org/doi/abs/10.1145/1401890.1401920)</sup> 大多数方法建立在完全随机选取（SCAR）假设之上：有标记集合是正例的一个均匀子集，等价于倾向为常数 e(x)=e=Pr(s=1|y=1,x)。<sup>[1](https://arxiv.org/abs/1811.04820)</sup><sup> • </sup><sup>[2](https://www.jmlr.org/papers/volume24/22-067/22-067.pdf)</sup> 在 SCAR 下，埃尔坎（Elkan）和诺托（Noto）的引理 1 给出 p(y=1|x)=p(s=1|x)/c，其中 c=p(s=1|y=1) 是标记频率；一个训练用于把正例与无标记数据分开的分类器（“非传统”分类器），通过将其输出除以 c，可转换为传统的正例对负例分类器。<sup>[3](https://dl.acm.org/doi/abs/10.1145/1401890.1401920)</sup><sup> • </sup><sup>[6](https://papersdb.cs.ualberta.ca/~papersdb/uploaded_files/1615/paper_6168-estimating-the-class-prior-and-posterior-from-noisy-positives-and-unlabeled-data.pdf)</sup>

类先验 α=Pr(y=1) 通过 c=Pr(s=1)/α 进入：知道先验等价于知道标记频率。<sup>[1](https://arxiv.org/abs/1811.04820)</sup> 仅从 PU 数据估计 α 是不适定的，因为 α 不可识别；没有标记既可以用正例先验很小来解释，也可以用标记频率很低来解释。<sup>[1](https://arxiv.org/abs/1811.04820)</sup> 当先验 π 已知时，PU 风险可改写为 \( R(f)=2\pi\cdot R_{1}(f)+R_{X}(f)-\pi \)，从而消去负例风险项，并把问题化为正例与无标记数据之间的代价敏感分类。<sup>[4](https://papers.nips.cc/paper_files/paper/2014/file/f032bc3f1eb547f716df87edb523b8f0-Paper.pdf)</sup> 在较弱的随机选取（SAR）假设下，倾向依赖于协变量（有症状的疾病携带者更可能被诊断），噪声后验满足 η̃(x)=e(x)η(x)，并且需要额外假设——例如倾向随 η(x) 增大而增大，或采用参数化倾向模型——才能保证可识别性。<sup>[2](https://www.jmlr.org/papers/volume24/22-067/22-067.pdf)</sup>

## 实现方法

已发表方法分为三类：两步技术、有偏学习和类先验融入。<sup>[1](https://arxiv.org/abs/1811.04820)</sup>

**两步法**首先从无标记集合中识别可靠负例，然后训练分类器区分有标记正例与这些可靠负例，预测 \( P(y=1) \) 而不是 \( P(s=1) \)；许多方法迭代扩展可靠负例集合。<sup>[1](https://arxiv.org/abs/1811.04820)</sup><sup> • </sup><sup>[7](https://link.springer.com/article/10.1007/s10489-025-06706-9)</sup> 在 S-EM 间谍技术中，将一部分正例（间谍样本）隐藏在无标记集合中，运行概率分类器，并在间谍标签上设置阈值以提取约 85% 的间谍样本，从而识别可靠负例。<sup>[8](https://www.irma-international.org/viewtitle/11026/?isxn=9781605660103)</sup><sup> • </sup><sup>[7](https://link.springer.com/article/10.1007/s10489-025-06706-9)</sup>

**有偏和加权方法**把无标记集合视为带噪声的负例。有偏 SVM 对误分类的正例和负例施加不同惩罚。<sup>[1](https://arxiv.org/abs/1811.04820)</sup> 加权逻辑回归用 Pr(s=0) 给正例加权，用 Pr(s=1) 给负例加权。<sup>[1](https://arxiv.org/abs/1811.04820)</sup> 埃尔坎和诺托的表述将每个无标记样本复制，使其部分计为正例、部分计为负例，并按估计为正例和负例的概率加权；标记频率估计为有标记验证样本的平均预测概率，这要求分类器校准良好。<sup>[1](https://arxiv.org/abs/1811.04820)</sup>

**无偏风险方法**则只用正例项和无标记项来表示分类风险。对于满足 \( \ell(m)+\ell(-m)=1 \) 的损失，PU 风险为 \( R_{\mathrm{N\text{-}PU}}(g)=2\theta_{\mathrm{P}}\cdot R_{\mathrm{P}}(g)+R_{\mathrm{U,N}}(g)-\theta_{\mathrm{P}} \)。<sup>[9](http://proceedings.mlr.press/v70/sakai17a/sakai17a.pdf)</sup> 类先验估计是一个单独的子问题：一种方法在皮尔逊散度下将正类的类条件密度与输入密度部分匹配，从而避免密度估计，但当类条件密度重叠时，该估计器存在正偏差。<sup>[10](http://www.ms.k.u-tokyo.ac.jp/sugi/2014/ClassPrior2.pdf)</sup>

## 起源

一项在统计查询模型下研究从正例和无标记样本进行 PAC 学习的理论工作表明，k-DNF 公式和 k-决策列表在该模型中可学习。<sup>[8](https://www.irma-international.org/viewtitle/11026/?isxn=9781605660103)</sup><sup> • </sup><sup>[11](https://www-alg.ist.hokudai.ac.jp/~thomas/ALT98/ABS/denis.html)</sup> 丹尼斯（Denis）、吉勒龙（Gilleron）和勒图泽（Letouzey）2005 年发表在《理论计算机科学》（Theoretical Computer Science）上的论文设计了一种算法框架，把任意统计查询算法转换为使用正例统计查询和实例统计查询的算法，证明了在权重可估计条件下，任何 SQ 可学习类都可从正例和无标记数据中学习，并提出 POSC4.5——一种基于 C4.5 的决策树归纳算法。<sup>[12](https://doi.org/10.1016/j.tcs.2005.09.007)</sup> 早期实用的两步算法包括 S-EM、PEBL 和 Roc-SVM。<sup>[8](https://www.irma-international.org/viewtitle/11026/?isxn=9781605660103)</sup> 在 SCAR 下，用正例和无标记数据训练的分类器所预测的概率与真实条件概率只相差一个常数因子。<sup>[3](https://dl.acm.org/doi/abs/10.1145/1401890.1401920)</sup> 无偏风险路线始于迪普莱西（du Plessis）、牛（Niu）和杉山（Sugiyama）2014 年在 NeurIPS 上的分析；nnPU 论文称该分析提出了首个无偏风险估计器；桐生（Kiryo）、牛、迪普莱西和杉山于 2017 年提出了非负风险估计器。<sup>[13](https://proceedings.neurips.cc/paper_files/paper/2017/file/7cce53cf90577442771720a370c3c723-Paper.pdf)</sup> 牛及其同事于 2016 年首次从理论上比较了 PU 学习与正例-负例（PN）学习，酒井（Sakai）及其同事于 2016 年提出了 PNU 组合。<sup>[14](https://papers.neurips.cc/paper_files/paper/2016/file/be3159ad04564bfb90db9e32851ebf9c-Paper.pdf)</sup><sup> • </sup><sup>[15](https://doi.org/10.48550/arxiv.1605.06955)</sup>

## 变体

- **uPU 与 nnPU。** 使用铰链损失等凸损失的无偏估计器在灵活模型下会因经验风险变为负值而过拟合；nnPU 使用 \( R_{\mathrm{nnPU}}(g)=\pi\cdot R^{+}_{p}(g)+\max\{0,R^{-}_{u}(g)-\pi\cdot R^{-}_{p}(g)\} \) 并解决了这一问题。<sup>[13](https://proceedings.neurips.cc/paper_files/paper/2017/file/7cce53cf90577442771720a370c3c723-Paper.pdf)</sup>
- **CSPU。** 代价敏感 PU 学习使用凸无偏双铰链损失 \( \ell_{\mathrm{DH}}(z)=\max(-z,\max(0,1/2-z/2)) \) 给假阴性损失和假阳性损失分配不同权重，可作为二次规划求解。<sup>[16](https://www.sciencedirect.com/science/article/abs/pii/S0020025521000037)</sup>
- **袋装方法。** 莫尔德莱（Mordelet）和韦尔（Vert）提出的 ProDiGe 在无标记数据的随机子集上迭代训练有偏 SVM，用于疾病基因预测。<sup>[17](https://doi.org/10.1186/1471-2105-12-389)</sup>
- **自动机器学习系统。** GA-Auto-PU 是首个用于 PU 学习的 AutoML 系统；BO-Auto-PU 和 EBO-Auto-PU 在 60 个数据集上相较既有基线取得了统计显著的准确率提升。<sup>[7](https://link.springer.com/article/10.1007/s10489-025-06706-9)</sup>

## 应用

已有记载的应用包括基因-疾病识别（PUDI 将无标记集合划分为可靠负例、可能正例、可能负例和弱负例集合，然后构建多级加权 SVM，并优于 ProDiGe）、<sup>[18](https://doi.org/10.1093/bioinformatics/bts504)</sup><sup> • </sup><sup>[17](https://doi.org/10.1186/1471-2105-12-389)</sup>垃圾评论检测、文本分类和异常检测。<sup>[2](https://www.jmlr.org/papers/volume24/22-067/22-067.pdf)</sup> PU 学习有两个主要目标：优先级排序，其中精确率最重要（基因优先级排序）；以及异常检测，其中召回率最重要（欺诈检测）；在综述论文中，9 篇优先级排序论文只有 4 篇报告了精确率，3 篇异常检测论文只有 1 篇报告了召回率。<sup>[5](https://kdd.org/exploration_files/p5-Evaluating_the_Predictive_Performance_of_Positive-_Unlabelled_Classifiers_a_brief_critical_review_and_practical_recommendations_for_improvement.pdf)</sup>

## 局限与替代方法

在真实的 PU 数据上，无标记实例的真实标签未知，因此真阳性率、假阴性率、精确率、召回率和 F 度量都无法正确计算，AUROC 在 SCAR 下也只是估计值。<sup>[5](https://kdd.org/exploration_files/p5-Evaluating_the_Predictive_Performance_of_Positive-_Unlabelled_Classifiers_a_brief_critical_review_and_practical_recommendations_for_improvement.pdf)</sup> 大多数已发表评估改用人工构造的 PU 数据：从标准 PN 数据集中把正例隐藏在负例集合中生成（综述的 51 篇论文中有 42 篇如此）。<sup>[5](https://kdd.org/exploration_files/p5-Evaluating_the_Predictive_Performance_of_Positive-_Unlabelled_Classifiers_a_brief_critical_review_and_practical_recommendations_for_improvement.pdf)</sup>

先验误估存在陡峭的失效阈值：在引用分析的代价敏感形式中，当估计的类先验小于真实先验的一半时，无法进行 PU 分类；不过当无标记数据由正例主导时，误差对先验估计误差不敏感。<sup>[4](https://papers.nips.cc/paper_files/paper/2014/file/f032bc3f1eb547f716df87edb523b8f0-Paper.pdf)</sup> 铰链损失等凸替代损失会引入多余惩罚，使分类边界产生偏差；在 USPS 上，斜坡损失给出了高得多的准确率，而使用铰链损失时，在类先验较大时有时所有样本都被判为正例。<sup>[4](https://papers.nips.cc/paper_files/paper/2014/file/f032bc3f1eb547f716df87edb523b8f0-Paper.pdf)</sup> 无分布假设的先验估计器依赖不可约假设；当该假设被违反时，它们会系统性地高估先验，而且这种违反无法从数据中验证。<sup>[19](https://ar5iv.labs.arxiv.org/html/2002.03673)</sup>

与替代方法相比：单类 SVM 方法对调参值敏感，且没有好的设置方法；有偏 SVM 在实验中已被报告表现更好。<sup>[3](https://dl.acm.org/doi/abs/10.1145/1401890.1401920)</sup> PU 学习是半监督学习的一种特例，完全缺少负例标签，可以说是更大的挑战。<sup>[7](https://link.springer.com/article/10.1007/s10489-025-06706-9)</sup> 与异常检测不同——异常检测中的离群点彼此不相似——PU 中的正例彼此相似而与负例不相似；与半监督学习不同，PU 没有任何负类的有标记样本。<sup>[20](https://astrakhantsev.com/pu-learning/)</sup>

## References

1. [Learning From Positive and Unlabeled Data: A Survey (Bekker & Davis; Machine Learning journal; arXiv; Springer and mirror copies merged here)](https://arxiv.org/abs/1811.04820)
2. [Risk Bounds for Positive-Unlabeled Learning Under the Selected At Random Assumption (JMLR vol. 24, 2023)](https://www.jmlr.org/papers/volume24/22-067/22-067.pdf)
3. [Learning classifiers from only positive and unlabeled data (Elkan & Noto, KDD 2008)](https://dl.acm.org/doi/abs/10.1145/1401890.1401920)
4. [Analysis of Learning from Positive and Unlabeled Data (du Plessis, Niu, Sugiyama, NeurIPS 2014)](https://papers.nips.cc/paper_files/paper/2014/file/f032bc3f1eb547f716df87edb523b8f0-Paper.pdf)
5. [Evaluating the Predictive Performance of Positive-Unlabelled Classifiers (ACM SIGKDD Explorations)](https://kdd.org/exploration_files/p5-Evaluating_the_Predictive_Performance_of_Positive-_Unlabelled_Classifiers_a_brief_critical_review_and_practical_recommendations_for_improvement.pdf)
6. [Estimating the class prior and posterior from noisy positives and unlabeled data (Kato et al., NIPS 2018-era)](https://papersdb.cs.ualberta.ca/~papersdb/uploaded_files/1615/paper_6168-estimating-the-class-prior-and-posterior-from-noisy-positives-and-unlabeled-data.pdf)
7. [Automated machine learning for positive-unlabelled learning (Applied Intelligence, 2025)](https://link.springer.com/article/10.1007/s10489-025-06706-9)
8. [Positive Unlabelled Learning for Document Classification (book chapter)](https://www.irma-international.org/viewtitle/11026/?isxn=9781605660103)
9. [Semi-supervised classification based on classification from positive and unlabeled data (PNU classification, Sakai et al., ICML 2017)](http://proceedings.mlr.press/v70/sakai17a/sakai17a.pdf)
10. [Direct Class-Prior Estimation via Pearson Divergence Partial Matching (du Plessis & Sugiyama, 2014)](http://www.ms.k.u-tokyo.ac.jp/sugi/2014/ClassPrior2.pdf)
11. [PAC Learning from Positive Statistical Queries (François Denis, ALT 1998, LNCS 1501)](https://www-alg.ist.hokudai.ac.jp/~thomas/ALT98/ABS/denis.html)
12. [François Denis, Rémi Gilleron, Fabien Letouzey (2005). Learning from positive and unlabeled examples. Theoretical Computer Science.](https://doi.org/10.1016/j.tcs.2005.09.007)
13. [Positive-Unlabeled Learning with Non-Negative Risk Estimator (Kiryo, Niu, du Plessis, Sugiyama; NeurIPS 2017)](https://proceedings.neurips.cc/paper_files/paper/2017/file/7cce53cf90577442771720a370c3c723-Paper.pdf)
14. [Theoretical Comparisons of Positive-Unlabeled Learning against Positive-Negative Learning (Niu et al., NeurIPS 2016)](https://papers.neurips.cc/paper_files/paper/2016/file/be3159ad04564bfb90db9e32851ebf9c-Paper.pdf)
15. [Sakai, Tomoya and colleagues (2016). Semi-Supervised Classification Based on Classification from Positive and Unlabeled Data. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1605.06955)
16. [Cost-sensitive positive and unlabeled learning (CSPU), Information Sciences](https://www.sciencedirect.com/science/article/abs/pii/S0020025521000037)
17. [Fantine Mordelet, Jean-Philippe Vert (2011). ProDiGe: Prioritization Of Disease Genes with multitask machine learning from positive and unlabeled examples. BMC Bioinformatics.](https://doi.org/10.1186/1471-2105-12-389)
18. [Peng Yang and colleagues (2012). Positive-unlabeled learning for disease gene identification. Bioinformatics.](https://doi.org/10.1093/bioinformatics/bts504)
19. [Rethinking Class-Prior Estimation for Positive-Unlabeled Learning (ReCPE, NeurIPS 2020)](https://ar5iv.labs.arxiv.org/html/2002.03673)
20. [Underrated Positive-Unlabeled learning: specifics, use-cases and tools](https://astrakhantsev.com/pu-learning/)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026 · Last review: Sep 30, 2026*

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

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/positive-unlabeled-learning

English original: https://www.edgepedia.org/positive-unlabeled-learning
