From 32f2418a077a8ddbde9b768fa30b16a789ecc486 Mon Sep 17 00:00:00 2001
From: Alexandre Gramfort <alexandre.gramfort@m4x.org>
Date: Thu, 8 Jun 2017 11:44:54 +0200
Subject: [PATCH] use ValueError

---
 sklearn/model_selection/_split.py           | 2 +-
 sklearn/model_selection/tests/test_split.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py
index 49b7874fac..7d9c8f9aad 100644
--- a/sklearn/model_selection/_split.py
+++ b/sklearn/model_selection/_split.py
@@ -1929,7 +1929,7 @@ def train_test_split(*arrays, **options):
 
     if shuffle is False:
         if stratify is not None:
-            raise NotImplementedError(
+            raise ValueError(
                 "Stratified train/test split is not implemented for "
                 "shuffle=False")
 
diff --git a/sklearn/model_selection/tests/test_split.py b/sklearn/model_selection/tests/test_split.py
index d6efff7b2b..ad77ecd7b8 100644
--- a/sklearn/model_selection/tests/test_split.py
+++ b/sklearn/model_selection/tests/test_split.py
@@ -931,7 +931,7 @@ def test_train_test_split_errors():
     assert_raises(TypeError, train_test_split, range(3),
                   some_argument=1.1)
     assert_raises(ValueError, train_test_split, range(3), range(42))
-    assert_raises(NotImplementedError, train_test_split, range(10),
+    assert_raises(ValueError, train_test_split, range(10),
                   shuffle=False, stratify=True)
 
 
-- 
GitLab