tra-analysis/analysis-master/analysis/metrics/elo.py
2020-05-01 15:52:27 -05:00

7 lines
233 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))