Jonas Arcangel
Jonas Arcangel

Reputation: 1925

Rank / Reputation Algorithm

I am writing an e-commerce engine that has a reputation component. I'd like users to be able to review and rate the items, and be able to rate the review.

What is the best algorithm to use to sort items based on "best" reviews? It has to be ranked by the amount of quality reviews it gets by the people who give the best reviews. I'm not sure how to translate this to algorithm.

For instance, I need to be able to compare between an item that has 5 stars from many people with low reputation, against another item that has 3 stars from a few people with high reputation.

To add to the complexity, some users may have written many reviews that are rate high / low by others, and other users may have written few reviews, but rated very high by other users. Which user is more reputable in this case?

Upvotes: 5

Views: 2734

Answers (2)

petrichor
petrichor

Reputation: 6569

If you know the reputations of the users, then you might use a UserScore for each user such as the one that Stackexchange uses.

UserScore = Reputation >= 200 ? 0.233 * ln(Reputation-101) - 0.75 : 0 + 1.5

Then you find the value of an item by summing up the user scores with the stars as weights:

ItemScore = \sum_i UserScore_i * Weight[Star_i]

where i is the index for the votes and Weight is the array involving the weights of stars. For example, it can be [-2 -1 0 1 2] for a voting system of 5 stars. And one note is that you may change the weight of the 3 stars to be +eps if you want the items with only 3 stars to come before the items which are not evaluated.

You may change 200 and all other constants/weights accordingly to your needs.

Upvotes: 12

mabounassif
mabounassif

Reputation: 2341

I will try to answer your question:

I think the trick is to weight out the people with different reputation, for instance:

A person with a reputation 2 has a vote that is 3x as heavy as the vote of another person with a lower reputation of 1. That relationship between people of different reputation is really up to you and how much you want to have the overall rating dependent on the ratings of people with low reputation. The higher the vote weight of a person with high reputation compared to a vote of a low reputation person, the less the overall reputation will change due to the low reputation votes.

So each person will have a weight let's say w_i, w_j etc.... and then the over all rating will be the weighted average of all:

example of overall rating of votes from two different persons i and j = (w_i*r_i)+(w_j*r_j)/(w_i + w_j)

where r_i, r_j are the ratings of person i and person j respectively.

To get the value of the weights of each person, you can for instance take the number of stars that person.

A good resource would be the following page: http://en.wikipedia.org/wiki/Weighted_mean

Upvotes: 0

Related Questions