Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FIX: allow the trivial border case k==n in KFold CV

  • Loading branch information...
commit 5b2491ef704d0a6e3530d88c90c34a7097e020c2 1 parent 9326b70
@ogrisel ogrisel authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 scikits/learn/tests/test_cross_val.py
View
6 scikits/learn/tests/test_cross_val.py
@@ -42,7 +42,7 @@ def score(self, X=None, Y=None):
def test_kfold():
# Check that errors are raise if there is not enough samples
- nose.tools.assert_raises(AssertionError, cross_val.KFold, 3, 3)
+ nose.tools.assert_raises(AssertionError, cross_val.KFold, 3, 4)
y = [0, 0, 1, 1, 2]
nose.tools.assert_raises(AssertionError, cross_val.StratifiedKFold, y, 3)
@@ -74,10 +74,10 @@ def test_permutation_score():
rng=0)
assert_true(score_label == score)
assert_true(pvalue_label == pvalue)
-
+
# set random y
y = np.mod(np.arange(len(y)), 3)
-
+
score, scores, pvalue = permutation_test_score(svm, X, y,
zero_one_score, cv)
assert_true(score < 0.5)
Please sign in to comment.
Something went wrong with that request. Please try again.