Skip to content

Commit

Permalink
FIX/DOC test_folds --> test_fold
Browse files Browse the repository at this point in the history
  • Loading branch information
raghavrv committed Jul 10, 2015
1 parent 789a316 commit fb8b1ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sklearn/model_selection/split.py
Expand Up @@ -947,12 +947,12 @@ class PredefinedSplit(BaseCrossValidator):
>>> from sklearn.model_selection import PredefinedSplit
>>> X = np.array([[1, 2], [3, 4], [1, 2], [3, 4]])
>>> y = np.array([0, 0, 1, 1])
>>> test_folds = [0, 1, -1, 1]
>>> test_fold = [0, 1, -1, 1]
>>> ps = PredefinedSplit(test_fold)
>>> ps.n_splits()
2
>>> print(ps) # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
PredefinedSplit(test_fold=[0 1 -1 1])
PredefinedSplit(test_fold=array([ 0, 1, -1, 1]))
>>> for train_index, test_index in ps.split():
... print("TRAIN:", train_index, "TEST:", test_index)
... X_train, X_test = X[train_index], X[test_index]
Expand Down

0 comments on commit fb8b1ac

Please sign in to comment.