LoslegenKostenlos loslegen

MICE imputation

The fancyimpute package offers various robust machine learning models for imputing missing values. You can explore the complete list of imputers from the detailed documentation. Here, we will use IterativeImputer or popularly called MICE for imputing missing values.

The IterativeImputer performs multiple regressions on random samples of the data and aggregates for imputing the missing values. You will use the diabetes DataFrame for performing this imputation.

Diese Übung ist Teil des Kurses

Dealing with Missing Data in Python

Kurs anzeigen

Anleitung zur Übung

  • Import IterativeImputer from fancyimpute.
  • Copy diabetes to diabetes_mice_imputed.
  • Create an IterativeImputer() object and assign it to mice_imputer.
  • Impute the diabetes_mice_imputed DataFrame.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Import IterativeImputer from fancyimpute
___

# Copy diabetes to diabetes_mice_imputed
diabetes_mice_imputed = ___

# Initialize IterativeImputer
mice_imputer = ___

# Impute using fit_tranform on diabetes_mice_imputed
diabetes_mice_imputed.iloc[:, :] = ___
Code bearbeiten und ausführen