diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2019-08-13 16:10:28 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2019-08-13 16:10:28 +0200 |
commit | ed64ef760b95600e8df4c7d6916671bcd7ed359e (patch) | |
tree | ebfad71846c5f8a9a7b8970bc1464aaca753c62f /lib/dfatool.py | |
parent | 93f7762fb23b95c0b5cef813e2d99ad221c03759 (diff) |
_try_fits: Do not throw away previous raw_results while iterating over parameters
Diffstat (limited to 'lib/dfatool.py')
-rwxr-xr-x | lib/dfatool.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/dfatool.py b/lib/dfatool.py index a66e673..1dc2291 100755 --- a/lib/dfatool.py +++ b/lib/dfatool.py @@ -989,14 +989,15 @@ def _try_fits(by_param, state_or_tran, model_attribute, param_index, safe_functi raw_results_by_param[other_parameters] = dict() results_by_param[other_parameters] = dict() for function_name, param_function in functions.items(): - raw_results[function_name] = {} + if not function_name in raw_results: + raw_results[function_name] = dict() error_function = param_function.error_function res = optimize.least_squares(error_function, [0, 1], args=(X, Y), xtol=2e-15) measures = regression_measures(param_function.eval(res.x, X), Y) raw_results_by_param[other_parameters][function_name] = measures for measure, error_rate in measures.items(): if not measure in raw_results[function_name]: - raw_results[function_name][measure] = [] + raw_results[function_name][measure] = list() raw_results[function_name][measure].append(error_rate) #print(function_name, res, measures) mean_measures = aggregate_measures(np.mean(Y), Y) |