Imputer

../../../../_images/imputer.svg

Replaces missing values in a data set with a computed value infered from the remained of the data set. If there are missing data in the data set, those needs to be removed or replaced first.

Documentation

Attributes

statistics_

The imputation fill value for each feature. Computing statistics can result in np.nan values. During transform(), features corresponding to np.nan statistics will be discarded.

Definition

Output ports

model model

Model

Configuration

Placeholder for missing values (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 can be set to either np.nan or pd.NA.

Imputing strategy (strategy)

The imputation strategy.

  • If “mean”, then replace missing values using the mean along each column. Can only be used with numeric data.

  • If “median”, then replace missing values using the median along each column. Can only be used with numeric data.

  • If “most_frequent”, then replace missing using the most frequent value along each column. Can be used with strings or numeric data. If there is more than one such value, only the smallest is returned.

  • If “constant”, then replace missing values with fill_value. Can be used with strings or numeric data.

New in version 0.20: strategy=”constant” for fixed value imputation.

Implementation

class node_preprocessing.Imputer[source]