new version of scikit-learn api

This commit is contained in:
Yong Mao
2020-02-18 09:44:49 +08:00
committed by GitHub
parent a293223107
commit 71e0465c9b

View File

@ -15,6 +15,9 @@ print("Y")
print(Y)
#Step 3: Handling the missing data
# If you use the newest version of sklearn, use the lines of code commented out
# from sklearn.impute import SimpleImputer
# imputer = SimpleImputer(missing_values="NaN", strategy="mean")
from sklearn.preprocessing import Imputer
imputer = Imputer(missing_values = "NaN", strategy = "mean", axis = 0)
imputer = imputer.fit(X[ : , 1:3])