Skip to content

Commit

Permalink
Adds changelog and solves pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
Raahul Singh committed Jun 13, 2020
1 parent 7f7432a commit 2f99d8a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 30 deletions.
1 change: 1 addition & 0 deletions changelog/26.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adds a module for ELO Ranking Algorithm.
4 changes: 2 additions & 2 deletions pythia/cleaning/elo.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def __init__(self, score_board: pd.DataFrame, *, k_value=32, default_score=1400,
column_map : dict, optional
Dictionary, for mapping the column names of the score_board dataframe
to variable names used in the ELO ranking system.
by default {"player 0": "image_id_0",
"player 1": "image_id_1",
by default {"player 0": "image_id_0",
"player 1": "image_id_1",
"score for player 0": "image0_more_complex_image1"}
"""
self.score_board = score_board
Expand Down
22 changes: 11 additions & 11 deletions pythia/cleaning/tests/test_elo.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def elo():
column_map = {"player 0": "image_id_0",
"player 1": "image_id_1",
"score for player 0": "image0_more_complex_image1"}

return ELO(score_board=sunspotter.classifications, column_map=column_map)


Expand All @@ -33,16 +33,16 @@ def test_expected_score(elo, rating_0, rating_1, expected_score):


@pytest.mark.parametrize('rating_for_image,k_value,score_for_image,image_expected_score,new_rating',
[(1400.0, 32, 1, 0.5, 1416.0),
(1450.0, 32, 0, 0.49928044265518673, 1434.023025835034),
(1500.0, 32, 0, 0.3572869311673796, 1488.5668182026438),
(1550.0, 32, 1, 0.14768898365874825, 1577.2739525229201),
(1600.0, 32, 1, 0.029314241270450396, 1631.0619442793457),
(1400.0, 32, 0, 0.5, 1384.0),
(1450.5, 32, 1, 0.5007195573448133, 1466.476974164966),
(1602.0, 32, 1, 0.6427130688326204, 1613.4331817973562),
(1854.5, 32, 0, 0.8523110163412517, 1827.2260474770799),
(2208.0, 32, 0, 0.9706857587295497, 2176.9380557206546)])
[(1400.0, 32, 1, 0.5, 1416.0),
(1450.0, 32, 0, 0.49928044265518673, 1434.023025835034),
(1500.0, 32, 0, 0.3572869311673796, 1488.5668182026438),
(1550.0, 32, 1, 0.14768898365874825, 1577.2739525229201),
(1600.0, 32, 1, 0.029314241270450396, 1631.0619442793457),
(1400.0, 32, 0, 0.5, 1384.0),
(1450.5, 32, 1, 0.5007195573448133, 1466.476974164966),
(1602.0, 32, 1, 0.6427130688326204, 1613.4331817973562),
(1854.5, 32, 0, 0.8523110163412517, 1827.2260474770799),
(2208.0, 32, 0, 0.9706857587295497, 2176.9380557206546)])
def test_new_rating(elo, rating_for_image, k_value, score_for_image, image_expected_score, new_rating):
assert elo.new_rating(rating_for_image, k_value, score_for_image, image_expected_score) == new_rating

Expand Down
6 changes: 0 additions & 6 deletions pythia/seo/tests/test_classifications.csv

This file was deleted.

11 changes: 0 additions & 11 deletions pythia/seo/tests/test_rankings.csv

This file was deleted.

0 comments on commit 2f99d8a

Please sign in to comment.