r/MathHelp • u/Imnust • Jan 06 '21
Applying weights to a ranking
I'm working on a small programming side project in which users can submit ratings for movies with the movies then ranked from highest average rating to lowest. The difficulty I'm having is that I'd like to include a weight for the quantity of ratings received as a movie that has received an average of 4.8/5 from 100 ratings is likely more indicative of quality than one that has 5 stars from a single rating.
I'm not great at math but a little research has shown me a few different approaches to achieve this effect - applying a sliding rule using Bayesian ranking, using the "Lower bound of Wilson score confidence interval for a Bernoulli parameter", and applying a simple weight that grows with the quantity of reviews.
Of the three approaches, my preferred option is for a simple weighting. Whilst I believe that both the Bayesian and Wilson score approaches would likely achieve more valid results, I think they are less appropriate for my system requirements (read: they are going to hammer my database) and frankly are a bit beyond my mathematical ability (I would prefer an approach whose implications I can have a more intuitive understanding of).
With this in mind I did a bit of googling and stumbled across this question on StackExchange which attempts to solve a similar problem. The accepted answer also appears to achieve the effect I'm after - a weight is applied that grows based on the quantity of ratings received.
However, I'm struggling to understand parts of the answer and the original author does not seem to be replying any more. For instance, their calculations when using Euler's number appear to be wrong and as my rating system is between 0-5 instead of 0-10, I'm not entirely sure which part of the equation to modify to account for this. In addition to this, I'm just generally unsure about the validity of their approach.
Any help would be greatly appreciated, either with the StackExchange answer or any other suggested solutions to the problem!
P.S. I apologise if this is not the correct subreddit for this kind of question. I have posted elsewhere but haven't receive many responses. If there is a more appropriate subreddit for this post then please could you direct me to it?
1
u/allmachine Jan 06 '21
I don't know the answer but I am interested to find out. At work I have done stuff like ranking each column (quantity of ratings, actual rating as a percentage, etc.) individually, then multiplying each individual rank by a tuned weight coefficient (eg. 0.5 will result in that column only being half as important as a 1 column), then adding all ranks together, and finally ranking the result. The problem is you'd have to recalculate everything whenever a single item gets inserted.
1
u/HorribleUsername Jan 06 '21
The simplest thing to do is to multiply the rating by 2. That converts it to a rating out of 10, which you can plug into the stackexchange formula.
I'm not sure I like that approach though. A 4/5 movie with 1000 votes, say, would rank above a 4.5/5 movie with 100 votes, which doesn't seem right.
1
u/AutoModerator Jan 06 '21
Reminder:
What have you tried so far? (See Rule #2)
Please don't delete your post. (See Rule #7)
We, the moderators of /r/MathHelp, appreciate that your question contributes to the MathHelp archived questions that will help others searching for similar answers in the future. Thank you for obeying these instructions.
(Note that this is an automatic message posted on every submission by default.)
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.