Abstract
Important tasks like record linkage and extreme classification demonstrate extreme class imbalance, with 1 minority instance to every 1 million or more majority instances. Obtaining a sufficient sample of all classes, even just to achieve statistically-significant evaluation, is so challenging that most current approaches yield poor estimates or incur impractical cost. Where importance sampling has been levied against this challenge, restrictive constraints are placed on performance metrics, estimates do not come with appropriate guarantees, or evaluations cannot adapt to incoming labels. This paper develops a framework for online evaluation based on adaptive importance sampling. Given a target performance metric and model for $p(y|x)$, the framework adapts a distribution over items to label in order to maximize statistical precision. We establish strong consistency and a central limit theorem for the resulting performance estimates, and instantiate our framework with worked examples that leverage Dirichlet-tree models. Experiments demonstrate an average MSE superior to state-of-the-art on fixed label budgets.
Introduction
In domains such as fraud detection, rare disease diagnosis, and record linkage, the "positive" class of interest is often buried under a mountain of negative instances—sometimes at ratios of 1:1,000,000. Evaluating machine learning models in these "needle in a haystack" scenarios is notoriously difficult. Standard passive sampling, which selects test points at random, is highly inefficient; one might need to label millions of examples just to find a handful of positive cases. This leads to performance estimates that are either prohibitively expensive or statistically unreliable.
While importance sampling (IS) can theoretically oversample rare events, existing IS-based evaluation methods suffer from several drawbacks: they are often rigid (tailored to a single metric like accuracy), lack adaptivity (failing to learn from new labels), and lack the theoretical guarantees—such as consistency and asymptotic normality—necessary for rigorous scientific evaluation.
The Adaptive Importance Sampling (AIS) Framework
This paper introduces a general framework for online supervised evaluation that addresses these limitations through two core innovations: Generalized Measures and Adaptive Importance Sampling.
Generalized Performance Measures
A key challenge in evaluation is the variety of metrics used (e.g., F1-score, Precision-Recall curves, Brier score). The authors unify these by defining performance metrics as transformations $g$ of "vector-valued risk functionals" $\ell(x, y)^\top$. This abstraction allows the framework to support a wide array of evaluation criteria by simply changing the underlying risk vector and the transformation function.
Adaptive Sampling with Dirichlet-Trees
The core of the framework is an iterative process that adapts the sampling distribution $q_t$ as labels are collected. The system uses a Bayesian model—specifically a Dirichlet-tree—to estimate the conditional probability $p(y|x)$.
The Dirichlet-tree utilizes a hierarchical partition of the data (e.g., binning items by their model scores). This structure allows the algorithm to "share strength" across similar data points. When an oracle provides a label for a specific item, the model updates its belief about the label distribution for all items in the same or similar partitions. This enables the system to home in on the most informative regions of the feature space in subsequent sampling rounds.
Crucially, the authors provide mathematical proofs for the strong consistency of the resulting estimates and establish a Central Limit Theorem. These guarantees allow practitioners to not only trust the point estimates but also to calculate valid confidence intervals.
Experimental Evaluation
The framework was evaluated on seven diverse datasets representing real-world imbalance challenges, including Entity Resolution (abt-buy, amzn-goog, dblp-acm, restaurant), Risk & Fraud (safedriver, creditcard), and Sentiment Analysis (tweets100k).
Key Results
- Superior Accuracy: In nearly all experiments, the proposed AIS method achieved a lower Mean Squared Error (MSE) for a fixed label budget compared to passive sampling, stratified sampling, and the state-of-the-art OASIS algorithm.
- Efficiency Gains: On highly imbalanced tasks like
amzn-goog, the method achieved MSE reductions of over an order of magnitude compared to traditional baselines. - Robustness: The adaptive mechanism proved robust to imperfect initial model scores. Even if the initial data partitioning was suboptimal, the algorithm successfully corrected its sampling strategy as more labels were acquired.
- Complex Metric Estimation: The method excels at estimating complex objects like entire Precision-Recall curves, which typically appear as jagged, uninformative plots under passive sampling in extreme imbalance settings.
Conclusion
The AIS framework provides a principled and efficient solution for evaluating models on rare events. By combining a flexible mathematical definition of performance measures with an adaptive, hierarchical sampling strategy, it significantly reduces the human labeling effort required for reliable evaluation.
Future work may address the computational overhead of the Bayesian inference step and explore more sophisticated initial partitioning strategies. Additionally, while the framework supports stochastic oracles (noisy labels), further empirical testing in high-noise environments remains an important next step.
Summary updated