Voting - Number of votes vs Vote percent?
Asked Answered
M

2

6

I've implemented a simple up/down voting system on a website, and I keep track of individual votes as well as vote time and unique user iD (hashed IP).

My question is not how to calculate the percent or sum of the votes - but more, what is a good algorithm for determining a good score based on votes?

I find sorting by pure vote percent to be unacceptable, as well as simply tallying upvotes.

Consider this example:

  • Image A: 4 upvotes, 1 downvotes
  • Image B: 5 upvotes, 4 downvotes
  • Image C: 1 upvote, 0 downvotes

The ideal system would put A first, maybe followed by B and then C.

In a pure percentage scenario, the order is C > A > B. (wrong) In a pure vote count scenario, the order is B > A > C. (wrong)

I have an idea for a somewhat "hybrid" algorithm based on the system's confidence in a score, maybe something along the lines of:

// (if totalvotes > 0, else score = 0)
score = 1 - ((downvotes+1 / totalvotes+1) * sqrt(1 / totalvotes))

However, I was hoping to ask the community if there are any really well-defined algorithms already out there that I simply don't know about, before I sit around tweaking my algorithm from now until sunset.

I also have date data for each vote - however, the content of the site isn't very time-sensitive so I don't really care to sort by "what's hot" at all.

Merrifield answered 22/4, 2012 at 17:44 Comment(2)
possible duplicate? At least the answer there is relevant.Thilde
Brilliant question, I must say :)Prepared
M
2

Sorting by the average of votes is not very good.

By instead balancing the proportion of positive ratings with the uncertainty of a small number of observations like explained in this article, you achieve a much better representation of your scores.

The article below explains how to not make the same mistake that many popular websites do. (Amazon, urbandictionary etc.)

http://evanmiller.org/how-not-to-sort-by-average-rating.html

Hope this helps!

Monotint answered 22/4, 2012 at 18:14 Comment(1)
Amazing link is amazing! Kudos for you, sir!Prepared
I
0

I know that doesn't answer your question, but I just spent 3 minutes for fun trying to find some formula and... just check it :) A column is upvotes and B is downvotes :)

=(LN((A1+1)/(A1+B1+1))+1)*LN(A1)

5   3       0.956866995
4   1       1.133543015
5   4       0.787295787
1   0       0
6   4       0.981910844
2   8       -0.207447157
6   5       0.826007385
3   3       0.483811507
4   0       1.386294361
5   0       1.609437912
6   1       1.552503332
5   2       1.146431478
100 100     -3.020151034
10  10      0.813671022
Isometric answered 22/4, 2012 at 17:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.