diff --git a/data analysis/analysis/__pycache__/analysis.cpython-36.pyc b/data analysis/analysis/__pycache__/analysis.cpython-36.pyc index 16f3a706..c61d176c 100644 Binary files a/data analysis/analysis/__pycache__/analysis.cpython-36.pyc and b/data analysis/analysis/__pycache__/analysis.cpython-36.pyc differ diff --git a/data analysis/analysis/analysis.py b/data analysis/analysis/analysis.py index d018c524..f9f77603 100644 --- a/data analysis/analysis/analysis.py +++ b/data analysis/analysis/analysis.py @@ -7,10 +7,15 @@ # current benchmark of optimization: 1.33 times faster # setup: -__version__ = "1.1.2.001" +__version__ = "1.1.2.003" # changelog should be viewed using print(analysis.__changelog__) __changelog__ = """changelog: +1.1.2.003: + - fixed elo() +1.1.2.002: + - added elo() + - elo() has bugs to be fixed 1.1.2.001: - readded regrression import 1.1.2.000: @@ -295,6 +300,13 @@ def regression_engine(device, inputs, outputs, args, loss = torch.nn.MSELoss(), return regressions +@jit(nopython=True) +def elo(starting_score, opposing_scores, observed, N, K): + + expected = 1/(1+10**((np.array(opposing_scores) - starting_score)/N)) + + return starting_score + K*(np.sum(observed) - np.sum(expected)) + @jit(forceobj=True) def r_squared(predictions, targets): # assumes equal size inputs