tra-analysis/analysis-master/tra_analysis/metrics/elo.py
Arthur Lu 8cea479880 renamed analysis folder to tra_analysis
Signed-off-by: Arthur Lu <learthurgo@gmail.com>
2020-08-10 21:01:50 +00: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))