### Install OpenSkillSharp via NuGet Source: https://github.com/myssto/openskillsharp/blob/master/README.md Install the OpenSkillSharp package using the .NET CLI or Package Manager Console. ```shell # via the dotnet CLI dotnet add package OpenSkillSharp ``` ```shell # via the Package Manager CLI Install-Package OpenSkillSharp ``` -------------------------------- ### Get Ordinal Rating for Sorting Source: https://github.com/myssto/openskillsharp/blob/master/README.md Retrieve the ordinal rating, calculated as mu - 3 * sigma, for displaying or sorting ratings. This provides a conservative estimate of a player's true rating. ```csharp PlackettLuce model = new(); IRating player = model.Rating(mu: 43.07, sigma: 2.42); player.Ordinal >> 35.81 ``` -------------------------------- ### Create and Customize OpenSkillSharp Models Source: https://github.com/myssto/openskillsharp/blob/master/README.md Instantiate a rating model with default parameters or customize its properties like Mu and Sigma. ```csharp // Create a model with default parameters PlackettLuce model = new(); ``` ```csharp // Or customize to your needs ThurstoneMostellerPart model = new() { Mu = 28.67, Sigma = 8.07, ... } ``` -------------------------------- ### Create Player Ratings Source: https://github.com/myssto/openskillsharp/blob/master/README.md Generate player ratings using a model, either with default values or specified Mu and Sigma. ```csharp PlackettLuce model = new(); IRating a1 = model.Rating(); >> {Rating} {Mu: 25, Sigma: 8.33148112355601} ``` ```csharp IRating a2 = model.Rating(mu: 32.444, sigma: 5.123); >> {Rating} {Mu: 32.444, Sigma: 5.123} ``` ```csharp IRating b1 = model.Rating(mu: 43.381, sigma: 2.421); >> {Rating} {Mu: 43.381, Sigma: 2.421} ``` ```csharp IRating b2 = model.Rating(mu: 25.188, sigma: 6.211); >> {Rating} {Mu: 25.188, Sigma: 6.211} ``` -------------------------------- ### Predict Match Winner Probabilities Source: https://github.com/myssto/openskillsharp/blob/master/README.md Calculate the relative probabilities of each team winning a match using the PredictWin method. The sum of probabilities for all teams in a match equals 1. ```csharp PlackettLuce model = new(); Team t1 = new() { Players = [model.Rating()] }; Team t2 = new() { Players = [model.Rating(mu: 33.564, sigma: 1.123)] }; List probabilities = model.PredictWin([t1, t2]).ToList(); >> { 0.45110899943132493, 0.5488910005686751 } probabilities.Sum(); >> 1 ``` -------------------------------- ### Update Player Ratings After a Game Source: https://github.com/myssto/openskillsharp/blob/master/README.md Update player ratings based on game outcomes using the Rate method. This method takes teams and returns updated teams with new ratings. ```csharp List result = model.Rate( [ new Team() { Players = [a1, a2] }, new Team() { Players = [b1, b2] } ] ).ToList(); result[0].Players >> {Rating} {Mu: 28.669648436582808, Sigma: 8.071520788025197} >> {Rating} {Mu: 33.83086971107981, Sigma: 5.062772998705765} result[1].Players >> {Rating} {Mu: 43.071274808241974, Sigma: 2.4166900452721256} >> {Rating} {Mu: 23.149503312339064, Sigma: 6.1378606973362135} ``` -------------------------------- ### Predict Match Draw Probability Source: https://github.com/myssto/openskillsharp/blob/master/README.md Estimate the relative chance of a draw occurring in a match using the PredictDraw method. This value is relative to other matches and may need meta-function adjustment for game-specific rules. ```csharp double prediction = model.PredictDraw([t1, t2]); >> 0.09025530533015186 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.