Class-prior Estimation for Learning from Positive and Unlabeled Data

Marthinus Christoffel du Plessis, Gang Niu, Masashi Sugiyama · DOI

Abstract

We consider the problem of estimating the class prior in an unlabeled dataset. Under the assumption that an additional labeled dataset is available, the class prior can be estimated by fitting a mixture of class-wise data distributions to the unlabeled data distribution. However, in practice, such an additional labeled dataset is often not available. In this paper, we show that, with additional samples coming only from the positive class, the class prior of the unlabeled dataset can be estimated correctly. Our key idea is to use properly penalized divergences for model fitting to cancel the error caused by the absence of negative samples. We further show that the use of the penalized $L_1$-distance gives a computationally efficient algorithm with an analytic solution. The consistency, stability, and estimation error are theoretically analyzed. Finally, we experimentally demonstrate the usefulness of the proposed method.

Introduction

In many real-world machine learning scenarios, labeled data is scarce. Often, we possess a set of confirmed positive instances (e.g., diagnosed patients) and a large pool of unlabeled data (e.g., the general population), which contains a mixture of both hidden positives and negatives. This paradigm is known as Positive and Unlabeled (PU) learning.

A critical challenge in PU learning is estimating the class prior ($\pi$), which represents the proportion of positive samples within the unlabeled pool. Accurate estimation of $\pi$ is essential for training effective classifiers from PU data. Traditional approaches attempt to fit a mixture model of the positive distribution to the unlabeled distribution. However, if the positive and negative classes overlap in the feature space, these methods tend to systematically overestimate the class prior because they misidentify overlapping negative samples as positives.

Figure 1: Comparison between full matching (requiring negative data) and partial matching (using only positive data).

Methodology: Penalized $f$-Divergences

To address the overestimation problem, we propose using penalized $f$-divergences for model fitting. The approach consists of two main components:

  1. Partial Matching: We define a partial model $q(x; \theta) = \theta p(x|y=1)$ and attempt to match this to the unlabeled density $p(x)$.
  2. The Penalty Mechanism: The core innovation lies in modifying the standard $f$-divergence function. In standard fitting, if the model $q$ exceeds the data $p$ at any point (i.e., the ratio $t = q/p > 1$), the divergence still yields a finite value. We demonstrate that by setting the penalty to infinity when $t > 1$, we can effectively cancel the error introduced by missing negative samples.

While several divergences can be penalized, we focus on the penalized $L_1$-distance. This specific choice results in a computationally efficient algorithm with an analytic solution, avoiding the need for complex iterative optimization.

Table 1: Common f-divergences and their corresponding penalized versions.

Experimental Evaluation

The proposed method was evaluated using both synthetic and real-world datasets, including the MNIST handwritten digit dataset. MNIST was transformed into a PU problem by treating one digit as "positive" and the rest as "negative," with dimensionality reduction applied to increase class overlap and difficulty.

Key Results

  • Theoretical Soundness: We provide rigorous proofs for the consistency, stability, and estimation error of the penalized $L_1$ estimator. It achieves the optimal parametric rate of $O_p(1/\sqrt{n})$.
  • Superior Accuracy: In MNIST experiments, the penL1 method consistently outperformed established baselines, such as the Elkan & Noto (EN) method and Pearson divergence (PE) matching, particularly in high-overlap scenarios.
  • Downstream Performance: Accurate class-prior estimation directly translated to better classification performance, with misclassification rates approaching those achieved using the true (oracle) class prior.

Conclusion

The systematic error inherent in PU learning due to missing negative samples can be neutralized through a "hard" penalty in the divergence calculation. By preventing the positive model from "overshooting" the unlabeled distribution, the estimator is forced toward the true class prior. The penalized $L_1$-distance is uniquely valuable in this context, simplifying the mathematical formulation into a form that can be solved analytically and rapidly.

Summary updated

BibTeX
@inproceedings{plessis2015class,
  author = {Marthinus Christoffel du Plessis and Gang Niu and Masashi Sugiyama},
  title = {{Class-prior Estimation for Learning from Positive and Unlabeled Data}},
  booktitle = {ACML},
  year = {2015},
  doi = {10.1007/s10994-016-5604-6},
}
Figure