Skip to content

Commit 9fe2fac

Browse files
committed
Add documentation about predict function
1 parent ee32aab commit 9fe2fac

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/manual.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,21 @@ from ``openskill.models`` like so:
9999
>>> rate([[a1], [b1], [c1], [d1]], rank=[4, 1, 3, 2], model=BradleyTerryFull)
100100
[[[17.09430584957905, 7.5012190693964005]], [[32.90569415042095, 7.5012190693964005]], [[22.36476861652635, 7.5012190693964005]], [[27.63523138347365, 7.5012190693964005]]]
101101
102+
Predicting Winners
103+
------------------
104+
105+
You can compare two or more teams to get the probabilities of each team winning.
106+
107+
.. code:: python
108+
109+
>>> from openskill import predict_win
110+
>>> a1 = Rating()
111+
>>> a2 = Rating(mu=33.564, sigma=1.123)
112+
>>> predictions = predict_win(teams=[[a1], [a2]])
113+
[0.45110901512761536, 0.5488909848723846]
114+
>>> sum(predictions)
115+
1.0
116+
102117
Available Models
103118
~~~~~~~~~~~~~~~~
104119

0 commit comments

Comments
 (0)