From ed64ef760b95600e8df4c7d6916671bcd7ed359e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 13 Aug 2019 16:10:28 +0200 Subject: _try_fits: Do not throw away previous raw_results while iterating over parameters --- lib/dfatool.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') 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) -- cgit v1.2.3