How wrong a measured rate can be
- : the measured success rate.
- : the number of examples.
An accuracy of 80 percent on 100 examples has a standard error of 4 points, so the true value is plausibly anywhere from 72 to 88.
That interval is what a single number on an evaluation set hides, and it is why two models three points apart on 100 examples are not distinguishable.
Precision improves with the square root, so halving the uncertainty costs four times the labelling.
Sizing an evaluation set
- : the margin of error you are willing to accept.
- for 95 percent confidence.
For a margin of 3 points around an expected 80 percent accuracy, that is 683 examples. For 1 point, it is 6,147.
The variance is highest at 50 percent, so using 0.5 gives a safe upper bound when the rate is unknown.
Comparing two models needs more than either alone
The error of a difference combines both errors, so distinguishing two similar systems takes roughly twice the data of measuring one.
Running both models on the identical set removes the variance from which examples were drawn, and it usually cuts the required size by half or more.
McNemar's test uses only the disagreements: the cases one got right and the other wrong. Everything both got right or both got wrong carries no information about which is better.
One evaluation, in order
- Decide the smallest difference that would change a decision.
- Compute the needed to detect it, before labelling anything.
- Evaluate both systems on the same examples.
- Report the interval, not only the point estimate.
- Test the difference on the disagreements rather than comparing two averages.
Where the arithmetic is optimistic
Correlated examples make the effective smaller than .
Ten questions about the same document are not ten independent samples, so a set built by expanding a few sources has less power than its size suggests.
Repeatedly checking an evaluation set and stopping when the result looks good inflates the false positive rate, exactly as it does in A and B testing.
Test 20 metrics at and one false win is expected.
Reporting many metrics on the same set invites the same problem, and the honest correction is to decide the primary metric first and treat the rest as description.