Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Voting - Number of votes vs Vote percent?

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.

like image 628
Tim Avatar asked Apr 22 '12 17:04

Tim


1 Answers

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!

like image 143
AlexanderN Avatar answered Oct 23 '22 19:10

AlexanderN