diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2022-06-14 10:36:15 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2022-06-14 10:36:15 +0200 |
commit | 81e14c3d175bdbcd360d6eb65250292c840a4dde (patch) | |
tree | 5c651d9cea92950497a5ecc0e5981f439824a53e /lib | |
parent | 0f97cbf0ba079c790500241ebe4cb961cfe92d42 (diff) |
MOdelAttribute/FOL: Ignore parameters that only have a single distinct value
Diffstat (limited to 'lib')
-rw-r--r-- | lib/parameters.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/parameters.py b/lib/parameters.py index 207b8d8..c9dda22 100644 --- a/lib/parameters.py +++ b/lib/parameters.py @@ -885,9 +885,12 @@ class ModelAttribute: ) ignore_param_indexes = list() if ignore_irrelevant: - for i, param in enumerate(self.param_names): + for param_index, param in enumerate(self.param_names): if not self.stats.depends_on_param(param): - ignore_param_indexes.append(i) + ignore_param_indexes.append(param_index) + for param_index, _ in enumerate(self.param_names): + if len(self.stats.distinct_values_by_param_index[param_index]) < 2: + ignore_param_indexes.append(param_index) x = df.FOLFunction(self.median, self.param_names) x.fit(self.param_values, self.data, ignore_param_indexes=ignore_param_indexes) if x.fit_success: |