removed \n s

This commit is contained in:
art 2020-03-03 16:27:30 -06:00
parent d00cf142c0
commit 51b3dd91b5

View File

@ -55,44 +55,28 @@ except:
import trueskill as Trueskill import trueskill as Trueskill
def main(): def main():
while(True): while(True):
config = load_config("config.csv") config = load_config("config.csv")
simpleloop(data, config) simpleloop(data, config)
def load_config(file): def load_config(file):
config_vector = {} config_vector = {}
file = an.load_csv(file) file = an.load_csv(file)
for line in file: for line in file:
config_vector[line[0]] = line[1:] config_vector[line[0]] = line[1:]
return config_vector return config_vector
def simpleloop(data, tests): # expects 3D array with [Team][Variable][Match] def simpleloop(data, tests): # expects 3D array with [Team][Variable][Match]
return_vector = {} return_vector = {}
for team in data: for team in data:
variable_vector = {} variable_vector = {}
for variable in data[team]: for variable in data[team]:
test_vector = {} test_vector = {}
variable_data = data[team][variable] variable_data = data[team][variable]
for test in tests[variable]: for test in tests[variable]:
test_vector[test] = simplestats(variable_data, test) test_vector[test] = simplestats(variable_data, test)
variable_vector[variable] = test_vector variable_vector[variable] = test_vector
return_vector[team] = variable_vector return_vector[team] = variable_vector
return return_vector return return_vector
@ -100,31 +84,24 @@ def simpleloop(data, tests): # expects 3D array with [Team][Variable][Match]
def simplestats(data, test): def simplestats(data, test):
if(test == "simple_stats"): if(test == "simple_stats"):
return an.basic_stats(data) return an.basic_stats(data)
if(test == "historical_analysis"): if(test == "historical_analysis"):
return an.histo_analysis(data) return an.histo_analysis(data)
if(test == "regression_linear"): if(test == "regression_linear"):
return an.regression('cpu', list(range(len(data))), data, ['lin']) return an.regression('cpu', list(range(len(data))), data, ['lin'])
if(test == "regression_logarithmic"): if(test == "regression_logarithmic"):
return an.regression('cpu', list(range(len(data))), data, ['log']) return an.regression('cpu', list(range(len(data))), data, ['log'])
if(test == "regression_exponential"): if(test == "regression_exponential"):
return an.regression('cpu', list(range(len(data))), data, ['exp']) return an.regression('cpu', list(range(len(data))), data, ['exp'])
if(test == "regression_polynomial"): if(test == "regression_polynomial"):
return an.regression('cpu', list(range(len(data))), data, ['ply']) return an.regression('cpu', list(range(len(data))), data, ['ply'])
if(test == "regression_sigmoidal"): if(test == "regression_sigmoidal"):
return an.regression('cpu', list(range(len(data))), data, ['sig']) return an.regression('cpu', list(range(len(data))), data, ['sig'])
def metricsloop(group_data, observations, database, tests): # listener based metrics update def metricsloop(group_data, observations, database, tests): # listener based metrics update