开发者

Weighted Average and Ratings

Maths isn't my strong point and I'm at a loss here.

Basically, all I need is a simple formula that will give a weighted rating on a scale of 1 to 5. If there are very fe开发者_运维技巧w votes, they carry less influence and the rating pressess more towards the average (in this case I want it to be 3, not the average of all other ratings).

I've tried a few different bayesian implementations but these haven't worked out. I believe the graphical representation I am looking for could be shown as:

     ___
    /
___/

Cheers


I'd do this this way

1*num(1) + 2*num(2) + 3*num(3) + 4*num(4) + 5*num(5) + A*3
-----------------------------------------------------------
      num(1) + num(2) + num(3) + num(4) + num(5) + A

Where num(i) is number of votes for i.
A is a parameter. I can't tell You exact value of it. It depends on what do You mean by "few votes". In general high value of A means that You need many votes to get average different than 3, low value of A means You need few votes to get different value than 3.

If You consider 5 as "few votes" then You can take A=5.

In this solution I just assume that each product starts with A votes for 3 instead of no votes.

Hope it helps.


(sum(ratings) / number(ratings)) * min(number(ratings), 10)/max(number(ratings), 10)

The first part is the un-normalized average rating. The second part will slowly increase the rating towards 5 as the number of individual ratings grows to 10. The question isn't clear enough for me to provide a better answer, but I believe the above formula might be something you can start with and adapt as you go. It goes without saying that you have to check if there are any ratings at all (not to divide by zero).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜