Skip to content

Fix PlackettLuce handling of ties#1

Merged
myssto merged 4 commits intomyssto:masterfrom
smoogipoo:fix-ties
Dec 20, 2025
Merged

Fix PlackettLuce handling of ties#1
myssto merged 4 commits intomyssto:masterfrom
smoogipoo:fix-ties

Conversation

@smoogipoo
Copy link
Contributor

Upstream went through its own bugfix in vivekjoshy/openskill.py#176, resulting in the test data being updated, which shows a further likely transcription issue in the code here.

Compare: https://github.com/vivekjoshy/openskill.py/blob/c9d3210ed068570cfa11a3f56586255c93d1a4c8/openskill/models/weng_lin/plackett_luce.py#L825-L828

@smoogipoo
Copy link
Contributor Author

Bundled another fix here for an exception when all scores are tied, because Average() throws if there are no elements.

Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at System.Linq.Enumerable.Average[TSource,TAccumulator,TResult](IEnumerable`1 source)
   at OpenSkillSharp.OpenSkillModelBase.<>c__DisplayClass45_0.<CalculateMarginAdjustedMu>b__1(ITeamRating qTeam, Int32 qTeamIndex) in /home/smgi/Repos/OpenSkillSharp/OpenSkillSharp/OpenSkillModelBase.cs:line 276

Compare: https://github.com/vivekjoshy/openskill.py/blob/c9d3210ed068570cfa11a3f56586255c93d1a4c8/openskill/models/weng_lin/plackett_luce.py#L790-L815 (notice if comparison_count else margin_adjustment)

smoogipoo added a commit to smoogipoo/osu-server-spectator that referenced this pull request Dec 15, 2025
@myssto myssto added the bug Something isn't working label Dec 16, 2025
@myssto
Copy link
Owner

myssto commented Dec 16, 2025

Thanks for this! Looks good as far as I can see but I will take a closer look soon and get this merged.

@myssto myssto merged commit efac516 into myssto:master Dec 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments