I am creating a 'duel' app and I am at a dead-end to calculating the results.
Each user either has an upvote or downvote. There is no 1-5 or five-star rating.
For example: If I were displayed 5 times and won 3, I would have 3 'upvotes' and 2 'downvotes'.
If I did straight percentages, any who was displayed 1 time and selected 1 time (100%) would always be the top where as if someone was 9/10 (90%) they would be below the 1/1 but in theory would belong on top.
Anyone have any ideas of how to accomplish this?
I, too, have been looking for a suitable algorithm for a voting website.
Whilst what @joshhendo suggested would appear to be a sound method of ranking votes, it doesn't take into account the percentage of positive votes.
For example:
For Item 1: 70-30 = 40
For Item 2: 400-300 = 100
Item 2 will appear above Item 1 because it has more positive votes. But Item 2 only has 25% positive votes, whereas Item 1 has ~57% positive votes. Item 1 should obviously appear above Item 2, because even though it doesn't have as many overall votes, it has a better 'up' to 'down' ratio of votes.
But then again, one wants to avoid the initial problem of items with 1 vote (positive) appearing above everything else.
I recommend you read this: http://www.evanmiller.org/how-not-to-sort-by-average-rating.html
It suggests a more mathematically sound solution to this problem. It's actually a very interesting read, and I will be implementing something similar into my own website.
[edit]
This is also a very good read: http://blog.linkibol.com/2010/05/07/how-to-build-a-popularity-algorithm-you-can-be-proud-of/
[/edit]
Rather than the positive vote percent, track a bayesian average of that, e.g.:
(positive votes + weighted avg positive votes) / (total votes + arbitrary sample)
http://en.wikipedia.org/wiki/Bayesian_average
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With