From 797a957dc6d4f19e4df94d3af6cc3e3d9ca9c21a Mon Sep 17 00:00:00 2001 From: Lion Yang Date: Wed, 20 Mar 2019 23:04:26 +0800 Subject: [PATCH] BP_improve.py: rename for new version of sklearn Renaming and depreaction of cross_validation submodule to model_selection. --- ch5_neural_networks/5.6_BP_improve/BP_improve.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ch5_neural_networks/5.6_BP_improve/BP_improve.py b/ch5_neural_networks/5.6_BP_improve/BP_improve.py index acee11b..a7ee2d1 100644 --- a/ch5_neural_networks/5.6_BP_improve/BP_improve.py +++ b/ch5_neural_networks/5.6_BP_improve/BP_improve.py @@ -3,7 +3,6 @@ ''''' @author: PY131 ''''' -from sklearn.decomposition.tests.test_nmf import random_state ''' preparation of data @@ -42,7 +41,7 @@ ''' split of train set and test set (using sklearn function) ''' -from sklearn.cross_validation import train_test_split +from sklearn.model_selection import train_test_split train_X, test_X, train_y, test_y, train_Y, test_Y = train_test_split(X,y,Y,test_size = 0.5, random_state = 42) '''