Skip to content

Commit

Permalink
Relax constraints on input X: Allow NaNs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
RicoFio authored Dec 4, 2024
1 parent acf6b27 commit 1efba1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ngboost/ngboost.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 1efba1e

Please sign in to comment.