diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-01-17 08:02:10 +0100 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-01-17 08:02:10 +0100 |
commit | 2a0ec8f13458e5659936cc5ba34600c68c09be30 (patch) | |
tree | 188b5d8f7eaae4915ebfaaf0d4fc6bf4dd130c91 /lib | |
parent | 14b59f86359d83af700e8d2e91168bb83a148c27 (diff) |
Stop splitting if there is no split that reduces loss
Diffstat (limited to 'lib')
-rw-r--r-- | lib/parameters.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/parameters.py b/lib/parameters.py index a32eb9f..ff0fdda 100644 --- a/lib/parameters.py +++ b/lib/parameters.py @@ -1306,7 +1306,9 @@ class ModelAttribute: assert not np.any(np.isnan(children)) loss.append(np.sum(children)) - if np.all(np.isinf(loss)): + if np.all(np.isinf(loss)) or np.min(loss) >= np.sum( + (np.array(data) - np.mean(data)) ** 2 + ): if ffs_feasible: # try generating a function. if it fails, model_function is a StaticFunction. ma = ModelAttribute( |