4

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 few 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

skaffman
  • 398,947
  • 96
  • 818
  • 769
Danten
  • 570
  • 6
  • 17

2 Answers2

5

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.

Tomek Tarczynski
  • 2,785
  • 8
  • 37
  • 43
1
(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).

Tomislav Nakic-Alfirevic
  • 10,017
  • 5
  • 38
  • 51
  • In the current state `(sum(ratings) / number(ratings)) * min(number(ratings), 10)/max(number(ratings), 10)`, the formula is not ready for use, it have a variable scaling factor issue, it seems to me that it is missing twin component to get balance between (original average, middle of range). 1st part is original average `(sum(ratings) / number(ratings))`, 2n part is variable scaling factor `min(number(ratings), 10)/max(number(ratings), 10)`. Let's take examples: 1 vote with rating 1, results 0.1!; 100 votes with rating 5, results 0.5!. Only 10 votes get factor of 1.0 and results original avg. – user.dz Feb 15 '20 at 09:52
  • If anyone interested in how it works, here a hint: try draw the plot of that factor function, `min(x,10)/max(x,10)` ; it is `x/10` for x<=10 and `10/x` for x>=10. – user.dz Feb 15 '20 at 09:58