4/11
Part 2 of 7 · Bayesian averagesLearn and do
Rank with the Bayesian average
A ranking is one sort away. The prior mean is the mean of every rating of every item, not the mean of the item averages, so an item with many ratings counts for more in it. Sort by the Bayesian average, best first, and break ties by name so the order never depends on how the items happened to be listed.
In the editor, write rank_by_bayes(items, weight). It prints three tents: one with a single 5, and two with many ratings.