fix DeprecationWarning on sklearn.cross_validation (#2075)

* fix DeprecationWarning on sklearn.cross_validation

* fix syntax

* fix kfold n_split issue

* fix mistype

* fix n_splits multiple value issue

* split should pass a iterable

* use np.arange instead of xrange, py3 compatibility
This commit is contained in:
Icyblade Dai
2017-03-17 21:38:22 +08:00
committed by Yuan (Terry) Tang
parent d581a3d0e7
commit 301540f1d9
5 changed files with 30 additions and 7 deletions

View File

@@ -11,7 +11,10 @@ class TestEarlyStopping(unittest.TestCase):
def test_early_stopping_nonparallel(self):
tm._skip_if_no_sklearn()
from sklearn.datasets import load_digits
from sklearn.cross_validation import train_test_split
try:
from sklearn.model_selection import train_test_split
except:
from sklearn.cross_validation import train_test_split
digits = load_digits(2)
X = digits['data']