Skip to content

Commit

Permalink
FIX: allow the trivial border case k==n in KFold CV
Browse files Browse the repository at this point in the history
  • Loading branch information
ogrisel committed Jan 19, 2011
1 parent 9326b70 commit 5b2491e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scikits/learn/tests/test_cross_val.py
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5b2491e

Please sign in to comment.