validate_data#
- validate_data(_estimator: BaseEstimator, /, X: ArrayLike, **kwargs) ndarray[source][source]#
Validate X and set n_features_in_ and n_samples_in_ on the estimator.
Thin wrapper around sklearn’s
validate_datathat additionally stores the number of samples as_estimator.n_samples_in_whenreset=True(i.e. during fit), which is required for default penalty computation.Within a
skip_validationcontext, sklearn’s checks are bypassed andXis only coerced to a numpy array; the fitted attributes are still set whenreset=True.- Parameters:
- _estimatorBaseEstimator
The estimator being fitted or applied. Modified in-place.
- Xarray-like of shape (n_samples, n_features)
Data to validate.
- **kwargs
Forwarded to
sklearn.utils.validation.validate_data.
- Returns:
- Xndarray of shape (n_samples, n_features)
Validated array.