Awesome
Wilson Score
Calculates the lower bound of the binomial proportion confidence interval as calculated by the Wilson score interval. If you're not retarded, you would use this score instead of averages when sorting and ranking (doesn't matter what the user sees). This is what reddit uses for "best".
API
var wilson = require('wilson-score')
wilson(up, total [, z-score])
up
- the total number of "yes"stotal
- the total number of votesz-score
- the z-score of the interval. By default, it's ~2.3 which corresponds to a 99% confidence interval. Use1.644853
for 95%.
Instead of calculating the average as up / total
,
calculate the wilson score via wilson(up, total)
.
The wilson score will always be lower than the average.