Comparing models¶
Corrected difference¶
diff = vc.compare_rates(audit, verdicts_a, verdicts_b)
If one judge scores both models and errs equally often for both, the corrected difference is
Judge errors always shrink the observed difference towards zero: an imperfect judge makes models look more similar than they are. The size of the shrinkage depends only on Youden's index.
Paired comparisons¶
If both models answered the same prompts, pass paired=True with the
verdicts in the same order. Pairing removes prompt difficulty from the
variance and usually narrows the interval considerably. Clusters can be
added for paired comparisons.
Deciding¶
vc.threshold_decision(diff, threshold=0.0, name="A minus B") # is A better?
vc.threshold_decision(diff, threshold=-0.02, name="A not worse") # non-inferiority
When the judge favours one model¶
If judge_consistency shows that the judge's error rates differ between
the two models (for example because it prefers the style of one of them),
the formula above is invalid. Audit each model separately, correct each
rate with its own audit, and compare the corrected rates.