algorithms1 min read
implementing bayesian average for robust rating systems
a simple average can give an item with very few votes a high position in a rating list. on telegramic, a bot or channel with one 5-star review would outrank one with a hundred 5-star reviews and two 1-star reviews.
i switched telegramic's sorting to a bayesian average. a prior pulls items with few votes toward the global average; as more votes arrive, the item's own ratings carry more weight.
this reduces the influence of a small number of votes. it doesn't guarantee the “correct” ranking: the result depends on the prior and how much weight it receives. the ordinary arithmetic mean remains visible on the frontend, while the backend sorts by the bayesian score.