From 1efba1e6dfb34fe34f233448023736d73d1a3d14 Mon Sep 17 00:00:00 2001 From: Riccardo Fiorista Date: Wed, 4 Dec 2024 07:42:05 -0500 Subject: [PATCH] Relax constraints on input X: Allow NaNs This change suggests to add the `'allow-nan'` parameter in the `check_X_y` function from `scikit-learn`. Its fully compatible with the API, as well as backward compatible for all users which have been using NGBoost for their prediction tasks. --- ngboost/ngboost.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ngboost/ngboost.py b/ngboost/ngboost.py index c8aa998..d6666ac 100644 --- a/ngboost/ngboost.py +++ b/ngboost/ngboost.py @@ -338,7 +338,7 @@ def partial_fit( raise ValueError("y cannot be None") X, Y = check_X_y( - X, Y, accept_sparse=True, y_numeric=True, multi_output=self.multi_output + X, Y, accept_sparse=True, y_numeric=True, multi_output=self.multi_output, force_all_finite='allow-nan' ) self.n_features = X.shape[1]