Imputation

class getml.preprocessors.Imputation(add_dummies: bool = False)[source]

Bases: getml.preprocessors.preprocessor._Preprocessor

The Imputation preprocessor replaces all NULL values in numerical columns with the mean of the remaining columns.

Optionally, it can additionally add a dummy column that signifies whether the original value was imputed.

Args:
add_dummies (bool):

Whether you want to add dummy variables that signify whether the original value was imputed..

Example:
imputation = getml.preprocessors.Imputation()

pipe = getml.Pipeline(
    population=population_placeholder,
    peripheral=[order_placeholder, trans_placeholder],
    preprocessors=[imputation],
    feature_learners=[feature_learner_1, feature_learner_2],
    feature_selectors=feature_selector,
    predictors=predictor,
    share_selected_features=0.5
)

Attributes Summary

add_dummies

Methods Summary

validate([params])

Checks both the types and the values of all instance variables and raises an exception if something is off.

Attributes Documentation

add_dummies: bool = False

Methods Documentation

validate(params=None)[source]

Checks both the types and the values of all instance variables and raises an exception if something is off.

Args:
params (dict, optional):

A dictionary containing the parameters to validate. If not is passed, the own parameters will be validated.