dask_ml.impute
.SimpleImputer¶
-
class
dask_ml.impute.
SimpleImputer
(*, missing_values=nan, strategy='mean', fill_value=None, verbose=0, copy=True, add_indicator=False)¶ Methods
fit
(X[, y])Fit the imputer on X. fit_transform
(X[, y])Fit to data, then transform it. get_params
([deep])Get parameters for this estimator. set_params
(**params)Set the parameters of this estimator. transform
(X)Impute all missing values in X. -
__init__
(*, missing_values=nan, strategy='mean', fill_value=None, verbose=0, copy=True, add_indicator=False)¶ Initialize self. See help(type(self)) for accurate signature.
-
fit
(X, y=None)¶ Fit the imputer on X.
Parameters: - X : {array-like, sparse matrix}, shape (n_samples, n_features)
Input data, where
n_samples
is the number of samples andn_features
is the number of features.
Returns: - self : SimpleImputer
-
fit_transform
(X, y=None, **fit_params)¶ Fit to data, then transform it.
Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.
Parameters: - X : {array-like, sparse matrix, dataframe} of shape (n_samples, n_features)
- y : ndarray of shape (n_samples,), default=None
Target values.
- **fit_params : dict
Additional fit parameters.
Returns: - X_new : ndarray array of shape (n_samples, n_features_new)
Transformed array.
-
get_params
(deep=True)¶ Get parameters for this estimator.
Parameters: - deep : bool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators.
Returns: - params : mapping of string to any
Parameter names mapped to their values.
-
set_params
(**params)¶ Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form
<component>__<parameter>
so that it’s possible to update each component of a nested object.Parameters: - **params : dict
Estimator parameters.
Returns: - self : object
Estimator instance.
-
transform
(X)¶ Impute all missing values in X.
Parameters: - X : {array-like, sparse matrix}, shape (n_samples, n_features)
The input data to complete.
-