ultra galaxybrain working

This commit is contained in:
Dev Singh 2020-03-06 14:44:13 -06:00
parent fb2800cf9e
commit 7b9e6921d0
3 changed files with 22 additions and 12 deletions

View File

@ -7,10 +7,12 @@
# current benchmark of optimization: 1.33 times faster # current benchmark of optimization: 1.33 times faster
# setup: # setup:
__version__ = "1.1.13.003" __version__ = "1.1.13.004"
# changelog should be viewed using print(analysis.__changelog__) # changelog should be viewed using print(analysis.__changelog__)
__changelog__ = """changelog: __changelog__ = """changelog:
1.1.13.004:
- small fixes to regression to improve performance
1.1.13.003: 1.1.13.003:
- filtered nans from regression - filtered nans from regression
1.1.13.002: 1.1.13.002:
@ -348,11 +350,9 @@ def histo_analysis(hist_data):
def regression(inputs, outputs, args): # inputs, outputs expects N-D array def regression(inputs, outputs, args): # inputs, outputs expects N-D array
inputs = np.array(inputs) X = np.array(inputs)
outputs = np.array(outputs) y = np.array(outputs)
inputs = inputs[np.isfinite(inputs)]
outputs = outputs[np.isfinite(outputs)]
regressions = [] regressions = []
if 'lin' in args: # formula: ax + b if 'lin' in args: # formula: ax + b

View File

@ -3,10 +3,13 @@
# Notes: # Notes:
# setup: # setup:
__version__ = "0.0.4.000" __version__ = "0.0.4.001"
# changelog should be viewed using print(analysis.__changelog__) # changelog should be viewed using print(analysis.__changelog__)
__changelog__ = """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: 0.0.4.000:
- fixed spelling issue in __changelog__ - fixed spelling issue in __changelog__
- addressed nan bug in regression - addressed nan bug in regression
@ -76,6 +79,7 @@ __all__ = [
from analysis import analysis as an from analysis import analysis as an
import data as d import data as d
import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import time import time
import warnings import warnings
@ -150,6 +154,8 @@ def simpleloop(data, tests): # expects 3D array with [Team][Variable][Match]
variable_data = data[team][variable] variable_data = data[team][variable]
if(variable in tests): if(variable in tests):
for test in tests[variable]: for test in tests[variable]:
print(team)
print(variable)
test_vector[test] = simplestats(variable_data, test) test_vector[test] = simplestats(variable_data, test)
else: else:
pass pass
@ -160,26 +166,30 @@ def simpleloop(data, tests): # expects 3D array with [Team][Variable][Match]
def simplestats(data, test): def simplestats(data, test):
data = np.array(data)
data = data[np.isfinite(data)]
ranges = list(range(len(data)))
if(test == "basic_stats"): if(test == "basic_stats"):
return an.basic_stats(data) return an.basic_stats(data)
if(test == "historical_analysis"): if(test == "historical_analysis"):
return an.histo_analysis([list(range(len(data))), data]) return an.histo_analysis([ranges, data])
if(test == "regression_linear"): if(test == "regression_linear"):
return an.regression(list(range(len(data))), data, ['lin']) return an.regression(ranges, data, ['lin'])
if(test == "regression_logarithmic"): if(test == "regression_logarithmic"):
return an.regression(list(range(len(data))), data, ['log']) return an.regression(ranges, data, ['log'])
if(test == "regression_exponential"): if(test == "regression_exponential"):
return an.regression(list(range(len(data))), data, ['exp']) return an.regression(ranges, data, ['exp'])
if(test == "regression_polynomial"): if(test == "regression_polynomial"):
return an.regression(list(range(len(data))), data, ['ply']) return an.regression(ranges, data, ['ply'])
if(test == "regression_sigmoidal"): 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): def push_to_database(apikey, competition, results, pit):