tra-analysis/analysis-master/tra_analysis/metrics/elo.py
Dev Singh 5d7ae52134 rename analysis to tra_analysis, bump version to 2.0.0
Signed-off-by: Dev Singh <dev@devksingh.com>
2020-08-10 13:28:37 -05:00

7 lines
221 B
Python

import numpy as np
def calculate(starting_score, opposing_score, observed, N, K):
expected = 1/(1+10**((np.array(opposing_score) - starting_score)/N))
return starting_score + K*(np.sum(observed) - np.sum(expected))