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?
If you know the reputations of the users, then you might use a
UserScorefor each user such as the one that Stackexchange uses.Then you find the value of an item by summing up the user scores with the stars as weights:
where
iis the index for the votes andWeightis 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+epsif 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.