All Projects → ndaidong → average-rating

ndaidong / average-rating

Licence: MIT license
Calculate average score and rating based on Wilson Score Equation

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to average-rating

openskill.py
Multiplayer rating system. Better than Elo.
Stars: ✭ 175 (+525%)
Mutual labels:  rating, rating-system
react-star-ratings
A customizable svg star rating component for selecting x stars or visualizing x stars
Stars: ✭ 128 (+357.14%)
Mutual labels:  rating, rating-stars
cyberrating
🚥 S&P of Blockchains
Stars: ✭ 13 (-53.57%)
Mutual labels:  rating, scoring
Ratemyapp
This plugin allows to kindly ask users to rate your app if custom conditions are met (eg. install time, number of launches, etc...).
Stars: ✭ 143 (+410.71%)
Mutual labels:  rating
Ngx Bar Rating
Angular Bar Rating
Stars: ✭ 146 (+421.43%)
Mutual labels:  rating
Vulnerability Rating Taxonomy
Bugcrowd’s baseline priority ratings for common security vulnerabilities
Stars: ✭ 227 (+710.71%)
Mutual labels:  rating
react-ratings-declarative
A customizable rating component for selecting x widgets or visualizing x widgets
Stars: ✭ 41 (+46.43%)
Mutual labels:  rating
Androidrate
AndroidRate is a library to help you promote your Android app by prompting users to rate the app after using it for a few days.
Stars: ✭ 117 (+317.86%)
Mutual labels:  rating
ScuffedMDB
An open-source website to rate movies watched with friends, made with next.js & chakra-ui. Hosted on vercel.com.
Stars: ✭ 100 (+257.14%)
Mutual labels:  rating
App review
App Review - Request and Write Reviews and Open Store Listing for Android and iOS in Flutter. Maintainer: @rodydavis
Stars: ✭ 213 (+660.71%)
Mutual labels:  rating
Raty
🌟 Raty - A Star Rating Plugin
Stars: ✭ 2,292 (+8085.71%)
Mutual labels:  rating
React Native In App Review
The Google Play In-App Review API, App store rating API lets you prompt users to submit Play Store or App store ratings and reviews without the inconvenience of leaving your app or game.
Stars: ✭ 175 (+525%)
Mutual labels:  rating
Rateit.js
Rating plugin for jQuery. Fast, Progressive enhancement, touch support, icon-font support, highly customizable, unobtrusive JavaScript (using HTML5 data-* attributes), RTL support, supports as many stars as you'd like, and also any step size.
Stars: ✭ 146 (+421.43%)
Mutual labels:  rating
Laravel-rating
Laravel package that allows you to rate, like & dislike and vote(+1,-1) your models with a simple and clear ways
Stars: ✭ 204 (+628.57%)
Mutual labels:  rating
Graphembeddingrecommendationsystem
Python based Graph Propagation algorithm, DeepWalk to evaluate and compare preference propagation algorithms in heterogeneous information networks from user item relation ship.
Stars: ✭ 144 (+414.29%)
Mutual labels:  rating
codeforces-upsolving-helper
A web app developed using Flask that compiles all the Problems on Codeforces that you have attempted (submitted at least once) but could not get Accepted verdict. Recommended Problems are also shown.
Stars: ✭ 61 (+117.86%)
Mutual labels:  rating
Moviecontentfilter
Watch movies with the freedom (not) to filter
Stars: ✭ 126 (+350%)
Mutual labels:  rating
Rating
Laravel Eloquent Rating allows you to assign ratings to any model.
Stars: ✭ 175 (+525%)
Mutual labels:  rating
Flutter rating bar
A simple ratingbar for flutter which also include a rating bar indicator, supporting any fraction of rating.
Stars: ✭ 211 (+653.57%)
Mutual labels:  rating
CP-Badges
Support for Competitive Coding badges to add in Github readme or portfolio websites.
Stars: ✭ 78 (+178.57%)
Mutual labels:  rating

average-rating

Calculate average and scoring based on Wilson Score Equation

NPM CI test Coverage Status CodeQL JavaScript Style Guide

Google app on Google Play

Setup

Usage

Node.js:

import {
  score,
  rate,
  average
} from 'average-rating'

// with CommonJS environment
// const { score, rate, average } = require('feed-reader/dist/cjs/average-rating.js')

score(80, 20) // => 0.71
average([134055, 57472, 143135, 365957, 1448459]) // => 4.4
rate([134055, 57472, 143135, 365957, 1448459]) // => 0.84

Browsers:

Currently ECMAScript modules work fine on almost browsers:

<script type="module">
import { average } from 'https://unpkg.com/average-rating/dist/average-rating.esm.js'

average([134055, 57472, 143135, 365957, 1448459])
</script>

With outdated browsers, we can use traditional way:

<script type="text/javascript" src="https://unpkg.com/average-rating/dist/average-rating.min.js"></script>

<script>
const { average } = window.AverageRating
average([134055, 57472, 143135, 365957, 1448459])
</script>

Example:

// get Winson score for a pair of (Positive, Negative) voting
score(0, 1000) // --> 0
score(1000, 0) // --> 0.96
score(1000, 1000) // --> 0.48

// from 1 to 5 stars
const rating = [134055, 57472, 143135, 365957, 1448459]
rate(rating) // --> 0.84

// calculate average
average(rating) // --> 4.4

APIs

.score(Number positive, Number negative)

Return a value from 0 to 1.

Used for the systems of Positive/Negative rating, such as the videos on YouTube, the answers on StackOverflow, etc. In which, each of item can be voted as good or bad, like or dislike or something like that.

.rate(Array ratings)

Return a value from 0 to 1.

Used for the systems of 5 rating levels, such as the applications on Google Play store, the books on Amazon, etc. In which, each of item can be voted as one of value in the range of 1 to 5 stars.

Update
  • Since v1.1.5, this rate method accepts custom range of ratings. 5 or more values are OK.
const input = [3, 4, 2, 6, 12, 46, 134, 213, 116, 91, 45, 15, 58, 96, 1654] // 15 values
rate(input) // => 0.85

rate([3, 4, 2, 6, 12, 46, 134, 213, 116, 91]) // => 0.74

.average(Array ratings)

Return a value from 0 to 5.

Calculate normal average value for the systems of 5 rating levels.

Test

git clone https://github.com/ndaidong/average-rating.git
cd average-rating
npm install
npm test

License

The MIT License (MIT)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].