Ranking Contest Results of Images with 5-Star Ratings

你。 提交于 2019-12-05 21:23:39
Tomaso Neri

You can simply calculate average score,

but it's better to add a correction for total number of votes given. One way to correct is to add "dummy" low votes (e.g. 10 ones), so

Photos with a large number of answers see their modified average alter very little from their real average, but photos with relatively few votes will see their modified average move considerably toward low values.

This is known as "Bayesian averaging". In effect, the photos with many answers will rank higher than photos with the same average but fewer votes.

I think I found an answer. So you just give a predefined number of downvotes to each item and that compensates slowly with the more votes the item gets. They weight the item gets is low but that doesn't matter in order to compare the weights. The best number of predefined downvotes I think would be the total number of votes for all items divided by the number of items (someone please fix it to ask for a list of items and rating, giving the proper number of downvotes).

In python:

pretend_votes = [50, 0, 0, 0, 0]                                                                                        
rating = [1, 2, 3, 4, 5]                                                                                             
def score(item_votes):                                                                                                  
    votes = [iv+pv for (iv,pv) in zip(item_votes,pretend_votes)]                                                        
    return sum(v*u for (v,u) in zip(votes,rating))/float(sum(votes))
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!