From 2a0ec8f13458e5659936cc5ba34600c68c09be30 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Wed, 17 Jan 2024 08:02:10 +0100 Subject: Stop splitting if there is no split that reduces loss --- lib/parameters.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') 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( -- cgit v1.2.3