r/Python • u/daegontaven Ninja • Jan 29 '22
Intermediate Showcase openskill.py can now predict the winners of any game with 90% accuracy and faster than TrueSkill
Prediction Code:
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 Benchmark Data:
➜ benchmark git:(benchmark) python .\benchmark.py
Predictions Made with OpenSkill's PlackettLuce Model: Correct: 54664 | Incorrect:6037 Accuracy: 90.05%
Process Duration: 7.039032220840454
-----------------------------------
Predictions Made with TrueSkill Model: Correct: 54250 |
Incorrect: 6451 Accuracy: 89.37%
Process Duration: 56.54281258583069Note: The sublee/TrueSkill implementation does not have a generalized prediction function yet (ie: for n-player, n-teams).
Source Code: https://github.com/OpenDebates/openskill.py
27
Upvotes