PHP/MySQL - algorithm for “Top Rated”

后端 未结 3 1502
猫巷女王i
猫巷女王i 2021-01-01 01:50

So I just built a star-rating system and and trying to come up with an algorithm to list the \"Top Rated\" items. For simplicity, here are the columns:

item_         


        
3条回答
  •  情歌与酒
    2021-01-01 02:42

    The question is, how much higher the 4.6/20 shall be rated than the 5.0/2...

    An idea not to take items in consideration that do not have at least x votes.

    Another idea is to fill up with "medium" votes. Decide that 10votes shall be the minimum. The 5.0/2 must be filled with 8 virtual votes of 2.5

    5.0/2 means 2 votes with 5.0, add 8 with 2.5 you'll get 30/10 -> 3.0 ;)

    Now, you have to decide how many votes an item shall at least have. For those that already have the minimum votes, a direct comparation shall be done.

    4.5/20 > 4.4/100
    5.0/2  < 3.1/20  (as 5.0/2 is, as we calculated, 3.0/10)
    

提交回复
热议问题