📜  sklearn impute - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:22.134000             🧑  作者: Mango

代码示例1
Imputation
my_imputer = SimpleImputer()
imputed_X_train = pd.DataFrame(my_imputer.fit_transform(X_train))
imputed_X_valid = pd.DataFrame(my_imputer.transform(X_valid))

# Imputation removed column names; put them back
imputed_X_train.columns = X_train.columns
imputed_X_valid.columns = X_valid.columns