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

[WIP] Implements ELO rating for sunspotter #26

Merged
merged 14 commits into from
Jun 30, 2020
Merged

[WIP] Implements ELO rating for sunspotter #26

merged 14 commits into from
Jun 30, 2020

Conversation

Raahul-Singh
Copy link
Owner

@Raahul-Singh Raahul-Singh commented Jun 6, 2020

This is the python implementation of the ELO score.
I need to figure out how to test this. Running it on the entire dataset will take a long time, and we cannot verify it otherwise.
Probably need to create some dummy data.
Finally, this may have some minute bugs that may have escaped manual testing. These will be sorted after we figure out testing.

Fixes: #7

@Raahul-Singh Raahul-Singh added this to the Data Cleaning milestone Jun 6, 2020
@Raahul-Singh Raahul-Singh requested a review from dpshelio June 6, 2020 11:32
@pep8speaks
Copy link

pep8speaks commented Jun 6, 2020

Hello @Raahul-Singh! Thanks for updating this PR.

Line 54:101: E501 line too long (130 > 100 characters)
Line 66:101: E501 line too long (123 > 100 characters)
Line 141:101: E501 line too long (121 > 100 characters)
Line 143:101: E501 line too long (121 > 100 characters)
Line 160:101: E501 line too long (108 > 100 characters)
Line 161:40: E127 continuation line over-indented for visual indent
Line 170:101: E501 line too long (123 > 100 characters)
Line 188:101: E501 line too long (113 > 100 characters)

Line 15:45: E251 unexpected spaces around keyword / parameter equals
Line 46:101: E501 line too long (103 > 100 characters)
Line 47:101: E501 line too long (118 > 100 characters)

Comment last updated at 2020-06-30 10:51:35 UTC

Copy link
Collaborator

@dpshelio dpshelio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good @Raahul-Singh I'm very happy with the quality shown in here! Well done. I've made some small comments (many are more of a conversation with myself 😅), you don't need to agree with them all.

Finally, maybe we want to keep this more general, then we may break this into ELO only and ELO for sunspotter.

pythia/seo/ELO.py Outdated Show resolved Hide resolved
pythia/seo/ELO.py Outdated Show resolved Hide resolved
pythia/seo/ELO.py Outdated Show resolved Hide resolved
pythia/seo/ELO.py Outdated Show resolved Hide resolved
pythia/seo/ELO.py Outdated Show resolved Hide resolved
pythia/seo/ELO.py Outdated Show resolved Hide resolved
pythia/seo/ELO.py Outdated Show resolved Hide resolved
pythia/seo/ELO.py Outdated Show resolved Hide resolved
pythia/seo/ELO.py Outdated Show resolved Hide resolved
pythia/seo/ELO.py Outdated Show resolved Hide resolved
@Raahul-Singh
Copy link
Owner Author

Rankings initially:

          image_id  score  k_value  count  std_dev last_scores
image_id                                                      
1                1   1400       32      0       32        1400
2                2   1400       32      0       32        1400
3                3   1400       32      0       32        1400
4                4   1400       32      0       32        1400
5                5   1400       32      0       32        1400
6                6   1400       32      0       32        1400
7                7   1400       32      0       32        1400
8                8   1400       32      0       32        1400
9                9   1400       32      0       32        1400
10              10   1400       32      0       32        1400

The matches are

    Player 1 id      Player 2 id     does player 1 win? (1: Yes, 0: No)
           1           6                           1
           2           7                           0
           3           8                           0
           4           9                           1
           5          10                           1

Rankings after each player have had one match:

      image_id   score  k_value  count  std_dev    last_scores
image_id                                                          
1                1  1416.0     16.0    1.0      8.0  1400.0,1416.0
2                2  1384.0     16.0    1.0      8.0  1400.0,1384.0
3                3  1384.0     16.0    1.0      8.0  1400.0,1384.0
4                4  1416.0     16.0    1.0      8.0  1400.0,1416.0
5                5  1416.0     16.0    1.0      8.0  1400.0,1416.0
6                6  1384.0     16.0    1.0      8.0  1400.0,1384.0
7                7  1416.0     16.0    1.0      8.0  1400.0,1416.0
8                8  1416.0     16.0    1.0      8.0  1400.0,1416.0
9                9  1384.0     16.0    1.0      8.0  1400.0,1384.0
10              10  1384.0     16.0    1.0      8.0  1400.0,1384.0

@Raahul-Singh
Copy link
Owner Author

@dpshelio if this looks good, I'll run it on the 14 years dataset and leave it to run overnight.

pythia/seo/elo.py Outdated Show resolved Hide resolved
pythia/seo/elo.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@drsophiemurray drsophiemurray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice tidy code @Raahul-Singh! Only a couple comments from me as I think @dpshelio covered most of it 👍

@Raahul-Singh Raahul-Singh force-pushed the elo branch 2 times, most recently from fe80767 to eb4bd83 Compare June 12, 2020 23:12
@Raahul-Singh Raahul-Singh force-pushed the elo branch 2 times, most recently from d0e8f9d to 70f61fe Compare June 13, 2020 09:33
Copy link
Collaborator

@dpshelio dpshelio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems good to me, so you can go ahead and merge it. You can create issues for the test data or names of variables to solve them later.

pythia/cleaning/elo.py Outdated Show resolved Hide resolved
pythia/cleaning/elo.py Outdated Show resolved Hide resolved
pythia/cleaning/elo.py Show resolved Hide resolved
pythia/cleaning/elo.py Outdated Show resolved Hide resolved
pythia/cleaning/elo.py Show resolved Hide resolved
pythia/cleaning/tests/test_elo.py Outdated Show resolved Hide resolved
pythia/cleaning/tests/test_elo.py Outdated Show resolved Hide resolved
pythia/cleaning/tests/test_elo.py Outdated Show resolved Hide resolved
pythia/cleaning/tests/test_elo.py Show resolved Hide resolved
@Raahul-Singh Raahul-Singh merged commit de451c2 into master Jun 30, 2020
@Raahul-Singh Raahul-Singh deleted the elo branch June 30, 2020 10:54
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.

Recreate the ELO rating.
4 participants