You are a web programmer. You have users. Your users rate stuff on your site. You want to put the highest-rated stuff at the top and lowest-rated at the bottom. You need some sort of “score” to sort by.
– Evan Miller, “How Not To Sort By Average Rating”
A better way to calculate ranking score to sort things on the web based on user upvotes or “stars”, using lower bound of Wilson score confidence interval for a Bernoulli parameter.
Calculates the score from the average of all reviews.
This function is curried.
confidence
NumberaverageRating
Number Average review score.maxRating
Number Maximum review score.totalReviews
Number Total number of reviews.
Returns Number Calculated score.
Calculates the score from a list of review counts.
This function is curried.
Returns Number Calculated score.
Calculates the score from the number of upvotes and downvotes.
This function is curried.
confidence
Numberupvotes
Number Number of positive reviews.downvotes
Number Number of negative reviews.
Returns Number Calculated score.