From 941ce7343e6204289870790ab0599a55fc7b1cf3 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 5 Feb 2019 10:39:58 +0100 Subject: ParamStats: Correctly handle data with stddev == 0 --- lib/dfatool.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/dfatool.py b/lib/dfatool.py index 93641d0..d0366d3 100755 --- a/lib/dfatool.py +++ b/lib/dfatool.py @@ -326,7 +326,7 @@ class ParamStats: if self.use_corrcoef: return 1 - np.abs(statistics['corr_by_param'][param]) if statistics['std_by_param'][param] == 0: - return 0 + return 1 return statistics['std_param_lut'] / statistics['std_by_param'][param] def param_dependence_ratio(self, state_or_trans, attribute, param): @@ -342,7 +342,7 @@ class ParamStats: if self.use_corrcoef: return 1 - np.abs(statistics['corr_by_arg'][arg_index]) if statistics['std_by_arg'][arg_index] == 0: - return 0 + return 1 return statistics['std_param_lut'] / statistics['std_by_arg'][arg_index] def arg_dependence_ratio(self, state_or_trans, attribute, arg_index): -- cgit v1.2.3