1
1
"""The NGBoost library"""
2
+
2
3
# pylint: disable=line-too-long,too-many-instance-attributes,too-many-arguments
3
4
# pylint: disable=unused-argument,too-many-locals,too-many-branches,too-many-statements
4
5
# pylint: disable=unused-variable,invalid-unary-operand-type,attribute-defined-outside-init
@@ -342,7 +343,12 @@ def partial_fit(
342
343
raise ValueError ("y cannot be None" )
343
344
344
345
X , Y = check_X_y (
345
- X , Y , accept_sparse = True , y_numeric = True , multi_output = self .multi_output
346
+ X ,
347
+ Y ,
348
+ accept_sparse = True ,
349
+ force_all_finite = "allow-nan" ,
350
+ multi_output = self .multi_output ,
351
+ y_numeric = True ,
346
352
)
347
353
348
354
self .n_features = X .shape [1 ]
@@ -357,8 +363,9 @@ def partial_fit(
357
363
X_val ,
358
364
Y_val ,
359
365
accept_sparse = True ,
360
- y_numeric = True ,
366
+ force_all_finite = "allow-nan" ,
361
367
multi_output = self .multi_output ,
368
+ y_numeric = True ,
362
369
)
363
370
val_params = self .pred_param (X_val )
364
371
val_loss_list = []
@@ -490,7 +497,7 @@ def pred_dist(self, X, max_iter=None):
490
497
A NGBoost distribution object
491
498
"""
492
499
493
- X = check_array (X , accept_sparse = True )
500
+ X = check_array (X , accept_sparse = True , force_all_finite = "allow-nan" )
494
501
495
502
params = np .asarray (self .pred_param (X , max_iter ))
496
503
dist = self .Dist (params .T )
@@ -537,7 +544,7 @@ def predict(self, X, max_iter=None):
537
544
Numpy array of the estimates of Y
538
545
"""
539
546
540
- X = check_array (X , accept_sparse = True )
547
+ X = check_array (X , accept_sparse = True , force_all_finite = "allow-nan" )
541
548
542
549
return self .pred_dist (X , max_iter = max_iter ).predict ()
543
550
0 commit comments