diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2021-10-13 16:16:36 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2021-10-13 16:16:36 +0200 |
commit | a2f34f9b4a9ed381f5173fd9f93c1e518b66e83b (patch) | |
tree | de7692a71611b8a0dcd46e1d0678b1c0afb46c18 /lib | |
parent | 0f59ffb5f2ecb3dc23764cd566d962e483bf31e2 (diff) |
codependent_param_dict: Do not throw away entirely non-numeric parameters.
They may be important for dtree generation.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/parameters.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/parameters.py b/lib/parameters.py index a5fe86c..c511815 100644 --- a/lib/parameters.py +++ b/lib/parameters.py @@ -599,13 +599,15 @@ class ModelAttribute: param1_numeric_count = sum(map(is_numeric, param1_values)) param2_values = map(lambda pv: pv[param2_index], self.param_values) param2_numeric_count = sum(map(is_numeric, param2_values)) - if param1_numeric_count >= param2_numeric_count: + # codependent parameter removal is only sensible for numeric parameters. For others (e.g. enums or boolean kconfig switches), dtree modeling + # automatically leaves out unimportant parameters. + if param1_numeric_count >= param2_numeric_count > 0: self.ignore_param[param2_index] = True self.codependent_params[param1_index].append(param2_index) logger.info( f"{self.name} {self.attr}: parameters ({self.log_param_names[param1_index]}, {self.log_param_names[param2_index]}) are codependent. Ignoring {self.log_param_names[param2_index]}" ) - else: + elif param2_numeric_count >= param1_numeric_count > 0: self.ignore_param[param1_index] = True self.codependent_params[param2_index].append(param1_index) logger.info( |