What is the best algorithm to calculate the most scored item?

前端 未结 5 797
名媛妹妹
名媛妹妹 2020-12-07 15:15

I have an music items that are scored by users between 1 to 5, and I need a formula to get the 5 most scored items.

But obviously an item that get 3.5 average score

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-07 15:52

    The reddit scoring algorithm is probably the best bet if you really want to do it the right way. It's explained in detail here and at a high level by xkcd author Randall here.

    The problem is it doesn't really work for five-star ratings which is what you're going for. You should be able to generalize reddit's sorting system to use ratings. Heck, it's probably done somewhere already. I'm going to look for it.

提交回复
热议问题