Search code examples
ranking

Weighted Voting Algorithm/Calculation


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?


Solution

  • 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