diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-03-08 13:42:21 +0100 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-03-08 13:42:21 +0100 |
commit | 3a6089bc4258e884b5ce909538b2f49a3dc87e78 (patch) | |
tree | 7f8d534e362bbe4b9e5c937e43b568e98a73c4e1 /lib | |
parent | c0f0c63631f0f4b48a1e4feef885d01e465e40ec (diff) |
build_rmt: handle sklearn.feature_selection.mutual_info_regression failures
Diffstat (limited to 'lib')
-rw-r--r-- | lib/parameters.py | 12 |
1 files changed, 9 insertions, 3 deletions
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() |