diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-02-05 10:39:58 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-02-05 10:39:58 +0100 |
commit | 941ce7343e6204289870790ab0599a55fc7b1cf3 (patch) | |
tree | 608b4bec17427ee00b2d0efdabd97f8591ce4894 | |
parent | cf435de43e643d911e2a59f121d70bc34de4483c (diff) |
ParamStats: Correctly handle data with stddev == 0
-rwxr-xr-x | lib/dfatool.py | 4 |
1 files changed, 2 insertions, 2 deletions
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): |