6/11
Part 4 of 7 · Thumbs upLearn and do
For thumbs-up ratings, rank by the Wilson lower bound
Some ratings are yes or no: helpful or not, thumbs up or down. Evan Miller's post on sorting them names two common mistakes. Positive minus negative puts an item with 1,000 more ups than downs, at 55% positive, above one with 200 more at 60%. And the plain share puts an item with 2 positive ratings and 0 negative at 100%, at the top.
His fix: sort by the lower bound of the Wilson score interval, a confidence interval for a share that NIST notes can never go below 0. The simple normal interval, p ± z √(p(1 − p)/n), fails right where you need it: at 2 of 2, p(1 − p) is 0, so its lower bound is a full 1.0.
import math
for name, ups, n in (("A", 2, 2), ("B", 90, 100), ("C", 600, 700)):
print(f"{name}: {ups}/{n} = {ups / n:.0%}, Wilson lower bound {wilson_lower(ups, n):.3f}")
A is 2 of 2, B is 90 of 100, and C is 600 of 700. Which ranks first by the Wilson lower bound?
Pick one to see what it prints.
Pick an answer above to see the rest