Skip to content

Imputers

Multiple imputation backends. Each imputer takes a Dataset and produces m completed datasets.

Class Backend Best for
MidasImputer (default) MIDAS denoising autoencoder Mixed types; general purpose
IterativeImputer scikit-learn IterativeImputer Moderate-sized numeric data
IterativeImputer2 Robust IterativeImputer variant Wide or sparse data

MidasImputer

MidasImputer(dataset=None)

Bases: Imputer

midas2_ deep-learning imputer (torch).

.. _midas2: https://github.com/MIDASverse/MIDASpy

get_m_complete(m=10, train_index=None, **kwargs)

Get m completed datasets

This method will return m completed datasets, if they have already been imputed, otherwise it will call the hidden completion method first.

IterativeImputer

IterativeImputer(dataset=None)

Bases: Imputer

sklearn.impute.IterativeImputer_ wrapper with sequential Y|X imputation.

Fits on X columns first, then imputes Y conditional on imputed X to avoid outcome leakage.

.. _sklearn.impute.IterativeImputer: https://scikit-learn.org/stable/modules/generated/sklearn.impute.IterativeImputer.html

get_m_complete(m=10, train_index=None, **kwargs)

Get m completed datasets

This method will return m completed datasets, if they have already been imputed, otherwise it will call the hidden completion method first.

IterativeImputer2

IterativeImputer2(dataset=None)

Bases: Imputer

sklearn.impute.IterativeImputer_ variant with extra numerical guards.

Prefills constant/empty columns and retries with reduced n_nearest_features on LinAlgError.

.. _sklearn.impute.IterativeImputer: https://scikit-learn.org/stable/modules/generated/sklearn.impute.IterativeImputer.html

get_m_complete(m=10, train_index=None, **kwargs)

Get m completed datasets (robust variant).