class sklearn.impute.MissingIndicator(missing_values=nan, features=’missing-only’, sparse=’auto’, error_on_new=True) [source]
Binary indicators for missing values.
| Parameters: |
|
|---|---|
| Attributes: |
|
>>> import numpy as np
>>> from sklearn.impute import MissingIndicator
>>> X1 = np.array([[np.nan, 1, 3],
... [4, 0, np.nan],
... [8, 1, 0]])
>>> X2 = np.array([[5, 1, np.nan],
... [np.nan, 2, 3],
... [2, 4, 0]])
>>> indicator = MissingIndicator()
>>> indicator.fit(X1)
MissingIndicator(error_on_new=True, features='missing-only',
missing_values=nan, sparse='auto')
>>> X2_tr = indicator.transform(X2)
>>> X2_tr
array([[False, True],
[ True, False],
[False, False]])
fit(X[, y]) | Fit the transformer on X. |
fit_transform(X[, y]) | Generate missing values indicator for X. |
get_params([deep]) | Get parameters for this estimator. |
set_params(**params) | Set the parameters of this estimator. |
transform(X) | Generate missing values indicator for X. |
__init__(missing_values=nan, features=’missing-only’, sparse=’auto’, error_on_new=True) [source]
fit(X, y=None) [source]
Fit the transformer on X.
| Parameters: |
|
|---|---|
| Returns: |
|
fit_transform(X, y=None) [source]
Generate missing values indicator for X.
| Parameters: |
|
|---|---|
| Returns: |
|
get_params(deep=True) [source]
Get parameters for this estimator.
| Parameters: |
|
|---|---|
| Returns: |
|
set_params(**params) [source]
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.
| Returns: |
|
|---|
transform(X) [source]
Generate missing values indicator for X.
| Parameters: |
|
|---|---|
| Returns: |
|
sklearn.impute.MissingIndicator
© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.impute.MissingIndicator.html