@@ -440,10 +440,10 @@ def check_X_y(X, y, accept_sparse=None, dtype="numeric", order=None, copy=False,
440
440
"""Input validation for standard estimators.
441
441
442
442
Checks X and y for consistent length, enforces X 2d and y 1d.
443
- Standard input checks are only applied to y. For multi-label y,
444
- set multi_output=True to allow 2d and sparse y.
445
- If the dtype of X is object, attempt converting to float,
446
- raising on failure.
443
+ Standard input checks are only applied to y, such as checking that y
444
+ does not have np.nan or np.inf targets. For multi-label y, set
445
+ multi_output=True to allow 2d and sparse y. If the dtype of X is
446
+ object, attempt converting to float, raising on failure.
447
447
448
448
Parameters
449
449
----------
@@ -473,7 +473,8 @@ def check_X_y(X, y, accept_sparse=None, dtype="numeric", order=None, copy=False,
473
473
be triggered by a conversion.
474
474
475
475
force_all_finite : boolean (default=True)
476
- Whether to raise an error on np.inf and np.nan in X.
476
+ Whether to raise an error on np.inf and np.nan in X. This parameter
477
+ does not influence whether y can have np.inf or np.nan values.
477
478
478
479
ensure_2d : boolean (default=True)
479
480
Whether to make X at least 2d.
@@ -483,7 +484,8 @@ def check_X_y(X, y, accept_sparse=None, dtype="numeric", order=None, copy=False,
483
484
484
485
multi_output : boolean (default=False)
485
486
Whether to allow 2-d y (array or sparse matrix). If false, y will be
486
- validated as a vector.
487
+ validated as a vector. y cannot have np.nan or np.inf values if
488
+ multi_output=True.
487
489
488
490
ensure_min_samples : int (default=1)
489
491
Make sure that X has a minimum number of samples in its first
0 commit comments