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.
Bu egzersiz
Dealing with Missing Data in Python
kursunun bir parçasıdırEgzersiz talimatları
- Import
IterativeImputerfromfancyimpute. - Copy
diabetestodiabetes_mice_imputed. - Create an
IterativeImputer()object and assign it tomice_imputer. - Impute the
diabetes_mice_imputedDataFrame.
Uygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
# 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[:, :] = ___