# MissingIndicator

### *class* cuml.preprocessing.MissingIndicator(\*args, \*\*kwargs)[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/_thirdparty/sklearn/preprocessing/_imputation.py#L519)

Binary indicators for missing values.

Note that this component typically should not be used in a vanilla
`Pipeline` consisting of transformers and a classifier, but rather
could be added using a `FeatureUnion` or `ColumnTransformer`.

* **Parameters:**
  **missing_values**
  : The placeholder for the missing values. All occurrences of
    `missing_values` will be imputed. For pandas’ dataframes with
    nullable integer dtypes with missing values, `missing_values`
    should be set to `np.nan`, since `pd.NA` will be converted to `np.nan`.

  **features**
  : Whether the imputer mask should represent all or a subset of
    features.
    - If “missing-only” (default), the imputer mask will only represent
      features containing missing values during fit time.
    - If “all”, the imputer mask will represent all features.

  **sparse**
  : Whether the imputer mask format should be sparse or dense.
    - If “auto” (default), the imputer mask will be of same type as
      input.
    - If True, the imputer mask will be a sparse matrix.
    - If False, the imputer mask will be a numpy array.

  **error_on_new**
  : If True (default), transform will raise an error when there are
    features with missing values in transform that have no missing values
    in fit. This is applicable only when `features="missing-only"`.
* **Attributes:**
  **features_**
  : The features indices which will be returned when calling `transform`.
    They are computed during `fit`. For `features='all'`, it is
    to `range(n_features)`.

### Methods

| [`fit`](#cuml.preprocessing.MissingIndicator.fit)(X[, y])                             | Fit the transformer on X.                    |
|------------------------------------------------------------------------------------------|----------------------------------------------|
| [`fit_transform`](#cuml.preprocessing.MissingIndicator.fit_transform)(X[, y])                   | Generate missing values indicator for X.     |
| [`get_feature_names_out`](#cuml.preprocessing.MissingIndicator.get_feature_names_out)([input_features]) | Get output feature names for transformation. |
| [`transform`](#cuml.preprocessing.MissingIndicator.transform)(X)                            | Generate missing values indicator for X.     |

### Examples

```pycon
>>> 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()
>>> X2_tr = indicator.transform(X2)
>>> X2_tr
array([[False,  True],
       [ True, False],
       [False, False]])
```

<!-- !! processed by numpydoc !! -->

#### fit(X, y=None) → [MissingIndicator](#cuml.preprocessing.MissingIndicator)[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/_thirdparty/sklearn/preprocessing/_imputation.py#L729)

Fit the transformer on X.

* **Parameters:**
  **X**
  : Input data, where `n_samples` is the number of samples and
    `n_features` is the number of features.
* **Returns:**
  **self**
  : Returns self.

<!-- !! processed by numpydoc !! -->

#### fit_transform(X, y=None)[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/_thirdparty/sklearn/preprocessing/_imputation.py#L813)

Generate missing values indicator for X.

* **Parameters:**
  **X**
  : The input data to complete.
* **Returns:**
  **Xt**
  : The missing indicator for input data. The data type of `Xt`
    will be boolean.

<!-- !! processed by numpydoc !! -->

#### get_feature_names_out(input_features=None)[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/_thirdparty/sklearn/preprocessing/_imputation.py#L788)

Get output feature names for transformation.

* **Parameters:**
  **input_features**
  : Input feature names.
* **Returns:**
  **feature_names_out**
  : Transformed feature names.

<!-- !! processed by numpydoc !! -->

#### get_params(deep=True)[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/internals/base.py#L191)

Returns a dict of all params owned by this class. If the child class
has appropriately overridden the `_get_param_names` method and does not
need anything other than what is there in this method, then it doesn’t
have to override this method

<!-- !! processed by numpydoc !! -->

#### set_params(\*\*params)[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/internals/base.py#L200)

Accepts a dict of params and updates the corresponding ones owned by
this class. If the child class has appropriately overridden the
`_get_param_names` method and does not need anything other than what is,
there in this method, then it doesn’t have to override this method

<!-- !! processed by numpydoc !! -->

#### transform(X)[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/_thirdparty/sklearn/preprocessing/_imputation.py#L748)

Generate missing values indicator for X.

* **Parameters:**
  **X**
  : The input data to complete.
* **Returns:**
  **Xt**
  : The missing indicator for input data. The data type of `Xt`
    will be boolean.

<!-- !! processed by numpydoc !! -->
