From c3043d8537e4dceb303929582dab92a6024924ce Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 12 Jan 2024 09:24:23 +0100 Subject: Expose DFATOOL_ULS_MIN_DISTINCT_VALUES training hyper-parameter --- lib/parameters.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/parameters.py b/lib/parameters.py index 74be565..3173784 100644 --- a/lib/parameters.py +++ b/lib/parameters.py @@ -604,7 +604,11 @@ class ModelAttribute: # There must be at least 3 distinct data values (≠ None) if an analytic model # is to be fitted. For 2 (or fewer) values, decision trees are better. - self.min_values_for_analytic_model = 3 + # Exceptions such as DFATOOL_FIT_LINEAR_ONLY=1 (2 values sufficient) + # can be handled via DFATOOL_ULS_MIN_DISTINCT_VALUES + self.min_values_for_analytic_model = int( + os.getenv("DFATOOL_ULS_MIN_DISTINCT_VALUES", "3") + ) def __repr__(self): mean = np.mean(self.data) -- cgit v1.2.3