Abstract: In this paper we propose strategies for estimating performance of a classifier when labels cannot be obtained for the whole test set. The number of test instances which can be labeled is very small compared to the whole test data size. The goal then is to obtain a precise estimate of classifier performance using as little labeling resource as possible. Specifically, we try to answer, how to select a subset of the large test set for labeling such that the performance of a classifier estimated on this subset is as close as possible to the one on the whole test set. We propose strategies based on stratified sampling for selecting this subset. We show that these strategies can reduce the variance in estimation of classifier accuracy by a significant amount compared to simple random sampling (over 65% in several cases). Hence, our proposed methods are much more precise compared to random sampling for accuracy estimation under restricted labeling resources. The reduction in number of samples required (compared to random sampling) to estimate the classifier accuracy with only 1% error is high as 60% in some cases.
1. Introduction
Evaluating machine learning models on massive datasets is computationally and financially expensive if ground-truth labels require manual human effort. In real-world "big data" deployments, test sets can reach millions of instances, while obtaining labels remains a tedious process often requiring domain experts.
When budget constraints limit labeling to a tiny fraction of the test data, the standard approach is simple random sampling. However, this method suffers from high variance, leading to imprecise accuracy estimates. This research addresses a critical question: How can we intelligently select a small subset of test instances to label such that our estimate of the classifier's overall accuracy is as precise as possible?
2. Methodology
The proposed solution centers on Stratified Sampling. Instead of sampling uniformly from the entire dataset, the test set is divided into $K$ distinct groups (strata) based on the classifier's output scores, such as predicted probabilities or SVM margins. The labeling budget $n$ is then distributed across these strata.
2.1 Stratification and Allocation
The paper explores two primary dimensions of this approach:
- Stratification Methods: Techniques to group the data, including standard statistical methods (cumulative $\sqrt{f}$), clustering (K-Means, Gaussian Mixture Models), and simple score partitioning (Equal Size, Equal Width).
- Allocation Methods: Strategies to distribute the budget $n$:
- Proportional: Budget is allocated based on the size of the stratum.
- Equal: Budget is divided equally ($n/K$) among all strata.
- Optimal: Budget is allocated based on both the size and the internal variance of the stratum.
2.2 Adaptive Variance Estimation
True optimal allocation requires knowing the variance of accuracy within each stratum beforehand, which is impossible without labels. To resolve this, the authors introduce two iterative algorithms, OPT-A1 and OPT-A2. These algorithms utilize a small initial labeling budget to estimate stratum variance, then dynamically allocate the remaining budget to the strata where it will most effectively reduce overall estimation variance.
3. Key Insights and Intuition
The effectiveness of stratified sampling relies on homogeneity. If a stratum is "pure"—meaning the classifier is either consistently correct or consistently incorrect within that group—its variance is low. Only a few samples are needed from such a group to confidently determine its accuracy. Stratifying by classifier confidence naturally creates these pure buckets at the extremes (very high or very low confidence) and mixed buckets in the middle.
Furthermore, the research suggests that stratified sampling is increasingly effective as classifier accuracy improves. In cases where a model is poorly trained and essentially guessing, the benefits of stratification over random sampling are diminished.
4. Experimental Evaluation
The methods were evaluated on three large-scale classification datasets: News20 (~20,000 instances), Epsilon (500,000 instances), and rcv1 (~700,000 instances).
4.1 Results
- Variance Reduction: Stratified sampling reduced the variance of accuracy estimates by over 65% in several scenarios compared to simple random sampling.
- Labeling Efficiency: To achieve a precise estimate with only 1% absolute error, stratified sampling reduced the required sample size by up to 60%. For instance, on the rcv1 dataset, the required samples dropped from 284 with random sampling to just 118 using equal allocation.
- Algorithm Performance: The iterative OPT-A2 algorithm consistently outperformed OPT-A1, providing an additional 5-18% variance reduction while remaining robust to initial parameter choices.
5. Conclusion and Future Work
Stratified sampling based on classifier confidence offers a significant leap in efficiency for model evaluation under resource constraints. While highly effective, the current method relies on 1D output scores and does not yet utilize the high-dimensional feature space, which could potentially yield even more homogeneous strata. Additionally, future work will address class skewness, ensuring that minority classes are not overlooked when labeling budgets are extremely small.
Summary updated