new version of scikit-learn api

This commit is contained in:
Yong Mao
2020-02-18 09:48:31 +08:00
committed by GitHub
parent 71e0465c9b
commit 240cd2191c

View File

@ -109,6 +109,9 @@
} }
], ],
"source": [ "source": [
"# 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\n", "from sklearn.preprocessing import Imputer\n",
"# axis=0表示按列进行\n", "# axis=0表示按列进行\n",
"imputer = Imputer(missing_values = \"NaN\", strategy = \"mean\", axis = 0)\n", "imputer = Imputer(missing_values = \"NaN\", strategy = \"mean\", axis = 0)\n",