From 3a6089bc4258e884b5ce909538b2f49a3dc87e78 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 8 Mar 2024 13:42:21 +0100 Subject: build_rmt: handle sklearn.feature_selection.mutual_info_regression failures --- lib/parameters.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/parameters.py b/lib/parameters.py index f680908..46a1e10 100644 --- a/lib/parameters.py +++ b/lib/parameters.py @@ -1134,9 +1134,15 @@ class ModelAttribute: if not ignore_index[i]: param_to_fit_param[i] = j j += 1 - mutual_information = sklearn.feature_selection.mutual_info_regression( - fit_parameters, data - ) + try: + mutual_information = ( + sklearn.feature_selection.mutual_info_regression( + fit_parameters, data + ) + ) + except ValueError as e: + logger.debug(f"mutual_info_regression failed: {e}") + mutual_information = [np.inf for _ in range(len(fit_parameters[0]))] if loss_ignore_scalar: ffs_eligible_params = list() -- cgit v1.2.3