Answers are grounded in this paper and cite their sources.
Supervised machine learning has become increasingly popular in social science research, often employing classifiers to measure political constructs. Although evaluating classifiers on a test set is critical for establishing their validity, guidance on how to conduct such evaluation is limited. In particular, researchers have paid insufficient attention to the variance of performance metrics estimated on test sets. This article demonstrates that typically sized test sets yield highly noisy and often uninformative estimates of classifier performance, particularly for imbalanced tasks—common in social science applications like identifying hateful or emotional speech—where one outcome class is rare. To address this issue, this article introduces methods to quantify uncertainty in performance estimates based on their sampling distribution and validated with simulations. It also introduces a design-based approach in political science to enhance statistical precision when evaluating classifiers: efficient stratified sampling based on the outcome’s predicted probability. Simulations using synthetic and real data show that this strategy meaningfully reduces the variance of performance estimates, especially in imbalanced tasks, while ensuring that they remain consistent. Finally, the article illustrates how to calculate the test set size required to achieve a desired level of statistical precision. Accompanying statistical software enables researchers to easily implement these methods.
No takes yet. Share an insight, caveat, or question.
Francisco Tomás-Valiente (2026) studied this question.
Synapse has enriched 10 related papers. Consider them for comparative context: