Giter VIP home page Giter VIP logo

sin / rating-score Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 57 KB

Calculate score to sort things by on the web based on upvotes or “stars”, using lower bound of Wilson score confidence interval for a Bernoulli parameter.

Home Page: https://www.npmjs.com/package/rating-score

License: MIT License

JavaScript 100.00%
rating-system rating-stars rating-statistics sorting-algorithms ranking-algorithms rating ranking-methods ranking-system

rating-score's Introduction

rating-score

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.

API

Table of Contents

averageToScore

Calculates the score from the average of all reviews.

This function is curried.

Parameters

  • confidence Number
  • averageRating Number Average review score.
  • maxRating Number Maximum review score.
  • totalReviews Number Total number of reviews.

Returns Number Calculated score.

starsToScore

Calculates the score from a list of review counts.

This function is curried.

Parameters

Returns Number Calculated score.

upvotesToScore

Calculates the score from the number of upvotes and downvotes.

This function is curried.

Parameters

  • confidence Number
  • upvotes Number Number of positive reviews.
  • downvotes Number Number of negative reviews.

Returns Number Calculated score.

rating-score's People

Contributors

sin avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.