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

前端 未结 5 809
名媛妹妹
名媛妹妹 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:50

    A simple way to balance the system is to add a fixed number of hypothetical users (say the count is H) who all vote for the long-term average A of all your pieces. Say that average is 3; then the formula becomes

    Score = (votesCount x votesAverage + H x A) / (votesCount + H)

    Now when votesCount grows, the relative impact of the hypothetical average-voters diminishes.

    You can set H experimentally, or by thinking about it. E.g. if you think that 20 votes is sufficient to establish relatively strong rating, you could set H=5. Say.

提交回复
热议问题