Skip to content

Commit

Permalink
Flip sign in normalized elo computation
Browse files Browse the repository at this point in the history
  • Loading branch information
kiudee committed Jan 29, 2020
1 parent 5d55527 commit 733cc79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tune/db_workers/tuning_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def query_data(self, cursor, tune_id, include_active=False):
# TODO: Support shrinking of ranges, by filtering X, y here
if include_active:
query = """
select X, avg((w-l) / (w + l - power(w-l, 2))) as y from
select X, -avg((w-l) / (w + l - power(w-l, 2))) as y from
(
select X, (wins::decimal+0.5) / (wins + draws + losses + 1.5) as w, (losses::decimal+0.5) / (wins + draws + losses + 1.5) as l
from tuning_jobs
Expand All @@ -168,7 +168,7 @@ def query_data(self, cursor, tune_id, include_active=False):
"""
else:
query = """
select X, avg((w-l) / (w + l - power(w-l, 2))) as y from
select X, -avg((w-l) / (w + l - power(w-l, 2))) as y from
(
select X, (wins::decimal+0.5) / (wins + draws + losses + 1.5) as w, (losses::decimal+0.5) / (wins + draws + losses + 1.5) as l
from tuning_jobs
Expand Down

0 comments on commit 733cc79

Please sign in to comment.