Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win probability for N:M case #17

Closed
wants to merge 2 commits into from
Closed

Conversation

romovpa
Copy link

@romovpa romovpa commented Oct 1, 2017

I've implemented win probability function for the special case when one team plays versus another and exactly one team wins. This case occurs frequently in my practice, I want to use those function out of the box.

The formula is proposed to me by @AVSirotkin (co-author of trueskill modifications), but it also mentioned in #1 here. Unfortunately, I cant give detailed explanation of the math behind this formula.

Usage

import trueskill

r1 = trueskill.Rating()
r2 = trueskill.Rating()

trueskill.probability_1vs1(r1, r2)  # 0.5000000150000002

r1, r2 = trueskill.rate_1vs1(r1, r2)

trueskill.probability_1vs1(r1, r2)  # 0.7732314666870078
trueskill.probability_1vs1(r2, r1) + trueskill.probability_1vs1(r1, r2)  # 1.0

trueskill.probability_NvsM((r1, r1, r1), (r2, r2, r2))  # 0.9028951782988498
trueskill.probability_NvsM((r1, r1, r1), (r1, r2, r2))  # 0.8066134315889564
trueskill.probability_NvsM((r2,), (r1, r2))  # 0.020365869935275418

@romovpa romovpa mentioned this pull request Oct 1, 2017
@coveralls
Copy link

coveralls commented Oct 1, 2017

Coverage Status

Coverage decreased (-1.2%) to 91.049% when pulling 1d6a204 on romovpa:master into ba42122 on sublee:master.

@coveralls
Copy link

coveralls commented Oct 1, 2017

Coverage Status

Coverage increased (+0.1%) to 92.327% when pulling 797bdb2 on romovpa:master into ba42122 on sublee:master.

@sublee
Copy link
Owner

sublee commented Oct 2, 2017

Thank you for the patch. But I don't think that the win probability can be a part of the TrueSkill library.

Here're the reasons:

  • All other parts of this library implement only the original TrueSkill™ spec. They have been proven by Microsoft Research. But the win probability has not.
  • Every TrueSkill functions should work well with any types of matches, not only 2 teams.
  • In my opinion, people can find the win probability formula easily. Even though we don't provide it by ourselves.

But that's true, #1 is the most common issue on this project. So I suggest you write some note in the documentation instead of providing a code.

@Tjorriemorrie
Copy link

Tjorriemorrie commented Oct 15, 2017

I would like to remark on some of those points:

3 that's not necessarily true, it took me a long time to find this, especially since I'm not familiar with stats at all, which means I'm not even sure what I'm looking for.

1 I would suggest that this is moved to an extras module. I agree it should be out of the main module, but excluding it is a bit too strict. This is also not the official TrueSkill repo. And making extra features available is what I like of python being batteries included.

2 Yes, I'm specifically looking for FFA. Currently I'm looping through every player and making two teams with the one player filling up the first team and the rest in the second team. I don't even know if that works :p

@sublee
Copy link
Owner

sublee commented Oct 16, 2017

Algorithms in this library are all proved by the TrueSkill™ paper. But in case of a win probability function, there's no reliable reference.

I designed this library's responsibility to be limited in only TrueSkill™. If this library provides more than that by extras module, the responsibility will be expanded unexpectedly. So I reject providing batteries for TrueSkill™.

I agree with you it's not enough easy to find that the win probability function. At this point, I think a documentation about that can be enough to help people although it's not a battery.

@romovpa
Copy link
Author

romovpa commented Oct 17, 2017

@romovpa romovpa closed this Oct 17, 2017
@sublee
Copy link
Owner

sublee commented Oct 18, 2017

Don't be discouraged. Your suggestion was reasonable. Keep your passion for the Open Source culture. 👍

@lukebyrne
Copy link

@romovpa Do you have a function to calculate win probability as per this question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants