From 1ca07266876e6934b73db7fddca7b535ece955c9 Mon Sep 17 00:00:00 2001 From: Dev Singh Date: Fri, 6 Mar 2020 14:44:13 -0600 Subject: [PATCH] ultra galaxybrain working --- .../__pycache__/analysis.cpython-37.pyc | Bin 26640 -> 26712 bytes data analysis/analysis/analysis.py | 10 ++++---- data analysis/superscript.py | 24 +++++++++++++----- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/data analysis/analysis/__pycache__/analysis.cpython-37.pyc b/data analysis/analysis/__pycache__/analysis.cpython-37.pyc index 9cd8c993cb9cf52831a77cadf81e97fcd49a7364..bccb944fa1eabf0b710618cff8189f3233f16b0e 100644 GIT binary patch delta 5130 zcmbVQ33yc16@K^4l3BA5AS4nDCSb>43@{QFBM>l%F%uHPHY6D)nU`V0Y}|Q)#Lf^< zL~4~H#|kdBiCSwZT4K~zwAQ6=RT0s{Q)4U(dNO%aEWS8ov48z2}~L z&VSFj@7(*?dyKttj5({EPMd^(i|%V}xv}55O*Xjw5!fT2QR$vnf zp)Ms+q{fQ4668uE5sF2r7mCDrY>QG9S9p7jNBq$?W#DGHW-2Rz4~k!5XAeA7GL5k^ zcz0SCs|4@#d)d+f=h+h&tA*n4Ozp`+_rzfd{t~y!lB7z#EGhM|ltHu@wv4Krl&)Y* z!Y89=P)eBsEGcg?^Q*h(1mu8Wr<5|Qh7Mz|DQQj`lEywmlbp&(S(2t+b26hhqfhF! z^hp7!UGBsAYozE|MoG19vi0!YOiEdqbeVAt4hOKk&AL`vCq?D8Qotx&e2Oki-`)lP z_-j1$n90Rn#v9N{#?A#NddKxieR9f~boS<=`SFxI z@kA%OykkPZkuTA&VgtTER|4q8zr$u?$_EzBZAqO8o|U=FyW z>?8I#>^bjs_B<%%7mjN}E#6Gfg5b*FYvKO#Gub+Lt$aRv2C`?~UQmMrUL*Ibip%V^ zsfs_6@CE#;pSQvbGmBXpoS2!%j)8U7=j`o$vlHeHvbG6w+njRWv(gOthYC122VlD`rA`ZV}6X>*h9NHjdA2 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>NcdZXQ6pRurN%*R)mBBAG@6V>PCzQ;hh!P z4o@rh>1kG0ywsafSHsK=q*Nx30uPd}L1+Dz49}IH@&J5k8`BY8dhUUtVqMggh^>l=UMF}Z^Z4ouXQ%TkY4*#Rf P2QT>7<39z)Z=CucGUV%; diff --git a/data analysis/analysis/analysis.py b/data analysis/analysis/analysis.py index 01262f96..e025c5f3 100644 --- a/data analysis/analysis/analysis.py +++ b/data analysis/analysis/analysis.py @@ -7,10 +7,12 @@ # current benchmark of optimization: 1.33 times faster # setup: -__version__ = "1.1.13.003" +__version__ = "1.1.13.004" # changelog should be viewed using print(analysis.__changelog__) __changelog__ = """changelog: + 1.1.13.004: + - small fixes to regression to improve performance 1.1.13.003: - filtered nans from regression 1.1.13.002: @@ -348,11 +350,9 @@ def histo_analysis(hist_data): def regression(inputs, outputs, args): # inputs, outputs expects N-D array - inputs = np.array(inputs) - outputs = np.array(outputs) + X = np.array(inputs) + y = np.array(outputs) - inputs = inputs[np.isfinite(inputs)] - outputs = outputs[np.isfinite(outputs)] regressions = [] if 'lin' in args: # formula: ax + b diff --git a/data analysis/superscript.py b/data analysis/superscript.py index 82dcd4f3..96567948 100644 --- a/data analysis/superscript.py +++ b/data analysis/superscript.py @@ -3,10 +3,13 @@ # Notes: # setup: -__version__ = "0.0.4.000" +__version__ = "0.0.4.001" # changelog should be viewed using print(analysis.__changelog__) __changelog__ = """changelog: + 0.0.4.001: + - fixed bug where X range for regression was determined before sanitization + - better sanitized data 0.0.4.000: - fixed spelling issue in __changelog__ - addressed nan bug in regression @@ -76,6 +79,7 @@ __all__ = [ from analysis import analysis as an import data as d +import numpy as np import matplotlib.pyplot as plt import time import warnings @@ -150,6 +154,8 @@ def simpleloop(data, tests): # expects 3D array with [Team][Variable][Match] variable_data = data[team][variable] if(variable in tests): for test in tests[variable]: + print(team) + print(variable) test_vector[test] = simplestats(variable_data, test) else: pass @@ -160,26 +166,30 @@ def simpleloop(data, tests): # expects 3D array with [Team][Variable][Match] def simplestats(data, test): + data = np.array(data) + data = data[np.isfinite(data)] + ranges = list(range(len(data))) + if(test == "basic_stats"): return an.basic_stats(data) if(test == "historical_analysis"): - return an.histo_analysis([list(range(len(data))), data]) + return an.histo_analysis([ranges, data]) if(test == "regression_linear"): - return an.regression(list(range(len(data))), data, ['lin']) + return an.regression(ranges, data, ['lin']) if(test == "regression_logarithmic"): - return an.regression(list(range(len(data))), data, ['log']) + return an.regression(ranges, data, ['log']) if(test == "regression_exponential"): - return an.regression(list(range(len(data))), data, ['exp']) + return an.regression(ranges, data, ['exp']) if(test == "regression_polynomial"): - return an.regression(list(range(len(data))), data, ['ply']) + return an.regression(ranges, data, ['ply']) if(test == "regression_sigmoidal"): - return an.regression(list(range(len(data))), data, ['sig']) + return an.regression(ranges, data, ['sig']) def push_to_database(apikey, competition, results, pit):