diff --git a/Code/Day 1_Data_Preprocessing.ipynb b/Code/Day 1_Data_Preprocessing.ipynb index 921b622..6dc6434 100644 --- a/Code/Day 1_Data_Preprocessing.ipynb +++ b/Code/Day 1_Data_Preprocessing.ipynb @@ -185,7 +185,7 @@ "metadata": {}, "source": [ "## 第五步:拆分数据集为测试集合和训练集合\n", - "把数据集拆分成两个:一个是用来训练模型的训练集合,另一个是用来验证模型的测试集合。两者比例一般是80:20。我们导入sklearn.crossvalidation库中的train_test_split()方法。" + "把数据集拆分成两个:一个是用来训练模型的训练集合,另一个是用来验证模型的测试集合。两者比例一般是80:20。我们导入sklearn.model_selection库中的train_test_split()方法。" ] }, { @@ -230,14 +230,10 @@ { "name": "stderr", "output_type": "stream", - "text": [ - "/home/ymao/usr/miniconda/lib/python3.6/site-packages/sklearn/cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.\n", - " \"This module will be removed in 0.20.\", DeprecationWarning)\n" - ] } ], "source": [ - "from sklearn.cross_validation import train_test_split\n", + "from sklearn.model_selection import train_test_split\n", "X_train, X_test, Y_train, Y_test = train_test_split( X , Y , test_size = 0.2, random_state = 0)\n", "print(\"---------------------\")\n", "print(\"Step 5: Splitting the datasets into training sets and Test sets\")\n",