question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GridSearchCV lacking documentation for cv parameter

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
amey-ghatecommented, Oct 28, 2018

I will pick it up.

1reaction
amuellercommented, Oct 26, 2018

thanks for opening the issue btw!

Read more comments on GitHub >

github_iconTop Results From Across the Web

GridSearchCV for Beginners - Towards Data Science
It runs through all the different parameters that is fed into the parameter grid and produces the best combination of parameters, based on...
Read more >
3.2. Tuning the hyper-parameters of an estimator - Scikit-learn
The GridSearchCV instance implements the usual estimator API: when “fitting” it on a dataset all the possible combinations of parameter values are evaluated ......
Read more >
GridSearch without CV - Data Science Stack Exchange
I create a Random Forest and Gradient Boosting Regressor by using GridSearchCV. For the Gradient Boosting Regressor, it takes too long for me....
Read more >
Hyperparameter Tuning with GridSearchCV - Great Learning
GridSearchCV is the process of performing hyperparameter tuning in order to determine the optimal values for a given model. What does cv in...
Read more >
How to use optimal parameters identified GridSearchCV
As stated by the GridSearchCV documentation: ... So, whenever you call cv.predict the best estimator, which has been refit, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found