yoonthegoon / openskill.hs

Haskell implementation of OpenSkill
MIT License
1 stars 0 forks source link

openskill.hs

image

Haskell implementation of OpenSkill

GitHub Actions Workflow Status Hackage Version GitHub License

Installation

git clone git@github.com:yoonthegoon/openskill.hs.git
cd openskill.hs
cabal install

Usage

import OpenSkill
  ( PlackettLuce (..), -- or any other ranking model
    Rating (..)
  )

main :: IO ()
main = do
  let pl = PlackettLuce (25, 25 / 3)
  let team1 =
    [ Rating 25 (25 / 6),
      Rating 25 (25 / 6)
    ]
  let team2 =
    [ Rating 25 (25 / 6),
      Rating 25 (25 / 6)
    ]
  let teams = [team1, team2]
  print $ rate pl teams [0, 1]
  print $ winProbability pl teams
[[Rating {theta = 26.964295, beta = 8.1779626},Rating {theta = 26.964295, beta = 8.1779626}],[Rating {theta = 23.035705, beta = 8.1779626},Rating {theta = 23.035705, beta = 8.1779626}]]
[0.5,0.5]

Implementations in other languages