All Projects → OpenDebates → openskill.py

OpenDebates / openskill.py

Licence: MIT license
Multiplayer rating system. Better than Elo.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to openskill.py

average-rating
Calculate average score and rating based on Wilson Score Equation
Stars: ✭ 28 (-84%)
Mutual labels:  rating, rating-system
cyberrating
🚥 S&P of Blockchains
Stars: ✭ 13 (-92.57%)
Mutual labels:  rating, ranking
Recommenders
Best Practices on Recommendation Systems
Stars: ✭ 11,818 (+6653.14%)
Mutual labels:  rating, ranking
Android Ratingreviews
Simple star rating system bars, a view similar to the ones seen on Google Playstore. ⭐🌟✨
Stars: ✭ 110 (-37.14%)
Mutual labels:  rating
Hibiscus.js
Native Angular directives for Bootstrap4
Stars: ✭ 115 (-34.29%)
Mutual labels:  rating
Rating
Laravel Eloquent Rating allows you to assign ratings to any model.
Stars: ✭ 175 (+0%)
Mutual labels:  rating
git-stars
Discover your ranking on GitHub
Stars: ✭ 37 (-78.86%)
Mutual labels:  ranking
Pyreclab
pyRecLab is a library for quickly testing and prototyping of traditional recommender system methods, such as User KNN, Item KNN and FunkSVD Collaborative Filtering. It is developed and maintained by Gabriel Sepúlveda and Vicente Domínguez, advised by Prof. Denis Parra, all of them in Computer Science Department at PUC Chile, IA Lab and SocVis Lab.
Stars: ✭ 108 (-38.29%)
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 (+20.57%)
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 (-16.57%)
Mutual labels:  rating
Ngx Bar Rating
Angular Bar Rating
Stars: ✭ 146 (-16.57%)
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 (-33.14%)
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 (+0%)
Mutual labels:  rating
Easy Rating Dialog
A plug and play ;) android library for displaying a "rate this app" dialog
Stars: ✭ 113 (-35.43%)
Mutual labels:  rating
Vulnerability Rating Taxonomy
Bugcrowd’s baseline priority ratings for common security vulnerabilities
Stars: ✭ 227 (+29.71%)
Mutual labels:  rating
Structured Data Json Ld
Collection of structured data snippets in Google preferred JSON-LD format.
Stars: ✭ 157 (-10.29%)
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 (+21.71%)
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 (-17.71%)
Mutual labels:  rating
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 (-18.29%)
Mutual labels:  rating
rater-js
Star rating widget for the browser. Unlimited number of stars. No dependencies. No Jquery required.
Stars: ✭ 66 (-62.29%)
Mutual labels:  rating

Logo of OpenSkill for Python - Multiplayer rating system. Better than Elo.

Multiplayer rating system. Better than Elo.

OpenSkill is a faster and open license multi-team, multiplayer rating system comparable to TrueSkill.

Stand With Ukraine

Tests codecov PyPI - Downloads Documentation Status

Description

PyPI - Python Version Conda (channel only) PyPI - Implementation

This is a port of the amazing openskill.js package and some of it's models are based on this wonderful paper. Designed for complex n-team, n-player matchups and ready out of the box with 5 different models and functions to suit your needs whether it be building video game leaderboards, matchmaking players or predicting how well a sports team will do.

Installation

pip install openskill

Usage

>>> from openskill import Rating, rate
>>> a1 = Rating()
>>> a1
Rating(mu=25.0, sigma=8.333333333333334)
>>> a2 = Rating(mu=32.444, sigma=5.123)
>>> a2
Rating(mu=32.444, sigma=5.123)
>>> b1 = Rating(43.381, 2.421)
>>> b1
Rating(mu=43.381, sigma=2.421)
>>> b2 = Rating(mu=25.188, sigma=6.211)
>>> b2
Rating(mu=25.188, sigma=6.211)

If a1 and a2 are on a team, and wins against a team of b1 and b2, send this into rate:

>>> [[x1, x2], [y1, y2]] = rate([[a1, a2], [b1, b2]])
>>> x1, x2, y1, y2
(Rating(mu=28.669648436582808, sigma=8.071520788025197), Rating(mu=33.83086971107981, sigma=5.062772998705765), Rating(mu=43.071274808241974, sigma=2.4166900452721256), Rating(mu=23.149503312339064, sigma=6.1378606973362135))

You can also create Rating objects by importing create_rating:

>>> from openskill import create_rating
>>> x1 = [28.669648436582808, 8.071520788025197]
>>> x1 = create_rating(x1)
>>> x1
Rating(mu=28.669648436582808, sigma=8.071520788025197)

Ranks

When displaying a rating, or sorting a list of ratings, you can use ordinal:

>>> from openskill import ordinal
>>> ordinal([43.07, 2.42])
35.81

By default, this returns mu - 3 * sigma, showing a rating for which there's a 99.7% likelihood the player's true rating is higher, so with early games, a player's ordinal rating will usually go up and could go up even if that player loses.

Artificial Ranks

If your teams are listed in one order but your ranking is in a different order, for convenience you can specify a ranks option, such as:

>>> a1 = b1 = c1 = d1 = Rating()
>>> result = [[a2], [b2], [c2], [d2]] = rate([[a1], [b1], [c1], [d1]], rank=[4, 1, 3, 2])
>>> result
[[Rating(mu=20.96265504062538, sigma=8.083731307186588)], [Rating(mu=27.795084971874736, sigma=8.263160757613477)], [Rating(mu=24.68943500312503, sigma=8.083731307186588)], [Rating(mu=26.552824984374855, sigma=8.179213704945203)]]

It's assumed that the lower ranks are better (wins), while higher ranks are worse (losses). You can provide a score instead, where lower is worse and higher is better. These can just be raw scores from the game, if you want.

Ties should have either equivalent rank or score.

>>> a1 = b1 = c1 = d1 = Rating()
>>> result = [[a2], [b2], [c2], [d2]] = rate([[a1], [b1], [c1], [d1]], score=[37, 19, 37, 42])
>>> result
[[Rating(mu=24.68943500312503, sigma=8.179213704945203)], [Rating(mu=22.826045021875203, sigma=8.179213704945203)], [Rating(mu=24.68943500312503, sigma=8.179213704945203)], [Rating(mu=27.795084971874736, sigma=8.263160757613477)]]

Predicting Winners

You can compare two or more teams to get the probabilities of each team winning.

>>> from openskill import predict_win
>>> a1 = Rating()
>>> a2 = Rating(mu=33.564, sigma=1.123)
>>> predictions = predict_win(teams=[[a1], [a2]])
>>> predictions
[0.45110901512761536, 0.5488909848723846]
>>> sum(predictions)
1.0

Predicting Draws

You can compare two or more teams to get the probabilities of the match drawing.

>>> from openskill import predict_draw
>>> a1 = Rating()
>>> a2 = Rating(mu=33.564, sigma=1.123)
>>> prediction = predict_draw(teams=[[a1], [a2]])
>>> prediction
0.09025541153402594

Predicting Ranks

Sometimes you want to know what the likelihood is someone will place at a particular rank. You can use this library to predict those odds.

>>> from openskill import predict_rank, predict_draw
>>> a1 = a2 = a3 = Rating(mu=34, sigma=0.25)
>>> b1 = b2 = b3 = Rating(mu=32, sigma=0.5)
>>> c1 = c2 = c3 = Rating(mu=30, sigma=1)
>>> team_1, team_2, team_3 = [a1, a2, a3], [b1, b2, b3], [c1, c2, c3]
>>> draw_probability = predict_draw(teams=[team_1, team_2, team_3])
>>> draw_probability
0.329538507466658
>>> rank_probability = predict_rank(teams=[team_1, team_2, team_3])
>>> rank_probability
[(1, 0.4450361350569973), (2, 0.19655022513040032), (3, 0.028875132345944337)]
>>> sum([y for x, y in rank_probability]) + draw_probability
1.0

Choosing Models

The default model is PlackettLuce. You can import alternate models from openskill.models like so:

>>> from openskill.models import BradleyTerryFull
>>> a1 = b1 = c1 = d1 = Rating()
>>> rate([[a1], [b1], [c1], [d1]], rank=[4, 1, 3, 2], model=BradleyTerryFull)
[[Rating(mu=17.09430584957905, sigma=7.5012190693964005)], [Rating(mu=32.90569415042095, sigma=7.5012190693964005)], [Rating(mu=22.36476861652635, sigma=7.5012190693964005)], [Rating(mu=27.63523138347365, sigma=7.5012190693964005)]]

Available Models

  • BradleyTerryFull: Full Pairing for Bradley-Terry
  • BradleyTerryPart: Partial Pairing for Bradley-Terry
  • PlackettLuce: Generalized Bradley-Terry
  • ThurstoneMostellerFull: Full Pairing for Thurstone-Mosteller
  • ThurstoneMostellerPart: Partial Pairing for Thurstone-Mosteller

Which Model Do I Want?

  • Bradley-Terry rating models follow a logistic distribution over a player's skill, similar to Glicko.
  • Thurstone-Mosteller rating models follow a gaussian distribution, similar to TrueSkill. Gaussian CDF/PDF functions differ in implementation from system to system (they're all just chebyshev approximations anyway). The accuracy of this model isn't usually as great either, but tuning this with an alternative gamma function can improve the accuracy if you really want to get into it.
  • Full pairing should have more accurate ratings over partial pairing, however in high k games (like a 100+ person marathon race), Bradley-Terry and Thurstone-Mosteller models need to do a calculation of joint probability which involves is a k-1 dimensional integration, which is computationally expensive. Use partial pairing in this case, where players only change based on their neighbors.
  • Plackett-Luce (default) is a generalized Bradley-Terry model for k ≥ 3 teams. It scales best.

Advanced Usage

You can learn more about how to configure this library to suit your custom needs in the project documentation.

Implementations in other Languages

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].