scikit-learn/scikit-learn — pull request #2054 by ogrisel (2013-06-11 09:14:35+00:00)
Title: Enforce n_folds >= 2 for k-fold cross-validation

Users might be confused if they set `n_folds=1` in `KFold` or `StratifiedKFold` as they would get empty training sets that can often results in model fit weird error messages.

This can happen if they naively use `cv=1` in `GridSearchCV` for instance. See: #2048 .