Skip to content

GridSearchCV lacking documentation for cv parameter #12466

@xhluca

Description

@xhluca

If this issue has been raised before or is out-of-context, please let me know and I will close this.

GridSearchCV documentation: http://scikit-learn.org/dev/modules/generated/sklearn.model_selection.GridSearchCV.html

User Guide: http://scikit-learn.org/dev/modules/cross_validation.html#cross-validation

Description

The current parameter description for cv is given as such:

cv : int, cross-validation generator or an iterable, optional
Determines the cross-validation splitting strategy. Possible inputs for cv are:

  • None, to use the default 3-fold cross validation,
  • integer, to specify the number of folds in a (Stratified)KFold,
  • An object to be used as a cross-validation generator.
  • An iterable yielding train, test splits.
  • For integer/None inputs, if the estimator is a classifier and y is either binary or multiclass, StratifiedKFold is used. In all other cases, KFold is used.

Refer User Guide for the various cross-validation strategies that can be used here.

However, it is unclear which objects and iterable we are talking about in this case. It also refers to the user guide, which doesn't show or link to examples of GridSearchCV using said object and iterable.

Suggestions

Link to existing examples of using object/iterable from the user guide, or directly from the parameter description. If non-existant, add relevant examples to the documentation.

Versions

scikit-learn 0.20

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions