Skip to content

fewlabels

Design and robustness for inference with AI predictions.

Human labels are expensive; AI predictions are cheap but imperfect. Prediction-powered inference (PPI) combines a small labelled sample with a large set of predictions and still produces confidence intervals with the nominal coverage, whatever the quality of the model. Good predictions make the interval narrower; poor predictions simply bring it back to the labelled-only interval.

The estimator itself is implemented in ppi_py. In practice, the hard questions come before and after the estimate:

Question fewlabels tool
How many cases must be labelled by hand? required_labels, required_labels_for_power
How should a budget be split between labelling and running the model? cost_optimal_allocation
How reliable is my plan if it is based on a small pilot? DesignParameters.from_pilot(conservative=True)
The labelled cases were chosen on purpose, not at random. ipw_ppi_mean
I cannot rule out that labelling depended on the outcome. selection_sensitivity, tipping_point
I have several AI annotators whose errors are related. ppi_mean with a prediction matrix, annotator_report
Several cases come from the same patient, site or document. ppi_mean(clusters_labeled=..., clusters_unlabeled=...), design_effect

Where to start

Install the package as described in Installation, then follow the Quick start. The Theory page derives every formula used in the package.