diff --git a/data analysis/analysis/__pycache__/analysis.cpython-37.pyc b/data analysis/analysis/__pycache__/analysis.cpython-37.pyc index ab9a7c01..9cd8c993 100644 Binary files a/data analysis/analysis/__pycache__/analysis.cpython-37.pyc and b/data analysis/analysis/__pycache__/analysis.cpython-37.pyc differ diff --git a/data analysis/analysis/analysis.py b/data analysis/analysis/analysis.py index 4d077276..01262f96 100644 --- a/data analysis/analysis/analysis.py +++ b/data analysis/analysis/analysis.py @@ -348,17 +348,17 @@ def histo_analysis(hist_data): def regression(inputs, outputs, args): # inputs, outputs expects N-D array - inputs = inputs[~np.isnan(inputs)] - outputs = outputs[~np.isnan(outputs)] + inputs = np.array(inputs) + outputs = np.array(outputs) + + inputs = inputs[np.isfinite(inputs)] + outputs = outputs[np.isfinite(outputs)] regressions = [] if 'lin' in args: # formula: ax + b try: - X = np.array(inputs) - y = np.array(outputs) - def func(x, a, b): return a * x + b @@ -375,9 +375,6 @@ def regression(inputs, outputs, args): # inputs, outputs expects N-D array try: - X = np.array(inputs) - y = np.array(outputs) - def func(x, a, b, c, d): return a * np.log(b*(x + c)) + d @@ -392,10 +389,7 @@ def regression(inputs, outputs, args): # inputs, outputs expects N-D array if 'exp' in args: # formula: a e ^ (b(x + c)) + d - try: - - X = np.array(inputs) - y = np.array(outputs) + try: def func(x, a, b, c, d): @@ -411,8 +405,8 @@ def regression(inputs, outputs, args): # inputs, outputs expects N-D array if 'ply' in args: # formula: a + bx^1 + cx^2 + dx^3 + ... - inputs = [inputs] - outputs = [outputs] + inputs = np.array([inputs]) + outputs = np.array([outputs]) plys = [] limit = len(outputs[0]) @@ -434,10 +428,7 @@ def regression(inputs, outputs, args): # inputs, outputs expects N-D array if 'sig' in args: # formula: a tanh (b(x + c)) + d - try: - - X = np.array(inputs) - y = np.array(outputs) + try: def func(x, a, b, c, d):