Last active
March 3, 2020 22:57
-
-
Save katronai/10ee85cfc238d29f4c61326065778551 to your computer and use it in GitHub Desktop.
Impute missing values
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imputer = Imputer(missing_values='NaN', strategy='mean', axis=0) | |
# imputer = Imputer(missing_values='NaN', strategy='median', axis=0) | |
# imputer = Imputer(missing_values='NaN', strategy='most_frequent', axis=0) | |
# imputer = Imputer(missing_values=0, strategy='mean', axis=0) | |
X_train = imputer.fit_transform(X_train) | |
X_test = imputer.transform(X_test) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment