Skip to content

Commit 77c20fa

Browse files
Allow NaNs in input X
1 parent acf6b27 commit 77c20fa

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ngboost/ngboost.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The NGBoost library"""
2+
23
# pylint: disable=line-too-long,too-many-instance-attributes,too-many-arguments
34
# pylint: disable=unused-argument,too-many-locals,too-many-branches,too-many-statements
45
# pylint: disable=unused-variable,invalid-unary-operand-type,attribute-defined-outside-init
@@ -338,7 +339,12 @@ def partial_fit(
338339
raise ValueError("y cannot be None")
339340

340341
X, Y = check_X_y(
341-
X, Y, accept_sparse=True, y_numeric=True, multi_output=self.multi_output
342+
X,
343+
Y,
344+
accept_sparse=True,
345+
force_all_finite="allow-nan",
346+
multi_output=self.multi_output,
347+
y_numeric=True,
342348
)
343349

344350
self.n_features = X.shape[1]
@@ -353,8 +359,9 @@ def partial_fit(
353359
X_val,
354360
Y_val,
355361
accept_sparse=True,
356-
y_numeric=True,
362+
force_all_finite="allow-nan",
357363
multi_output=self.multi_output,
364+
y_numeric=True,
358365
)
359366
val_params = self.pred_param(X_val)
360367
val_loss_list = []

0 commit comments

Comments
 (0)