Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FEA add ValidationCurveDisplay in model_selection module - #25120

Merged
jeremiedbb merged 52 commits into
scikit-learn:mainfrom
glemaitre:validation_curve_display
Jun 14, 2023
Merged

FEA add ValidationCurveDisplay in model_selection module#25120
jeremiedbb merged 52 commits into
scikit-learn:mainfrom
glemaitre:validation_curve_display

Conversation

@glemaitre

@glemaitre glemaitre commented Dec 6, 2022

Copy link
Copy Markdown
Member

Add ValidationCurveDisplay to the model_selection module.

This is the missing curve for the module.

@glemaitre
glemaitre marked this pull request as draft December 6, 2022 12:52
@glemaitre
glemaitre marked this pull request as ready for review December 6, 2022 13:42
@glemaitre

Copy link
Copy Markdown
Member Author

ping @ArturoAmorQ since this is something that we probably used in the MOOC.

@ArturoAmorQ

Copy link
Copy Markdown
Member

Don't forget to add the ValidationCurveDisplay to the Display Objects section of the Visualizations module in the User Guide ;)

@ArturoAmorQ ArturoAmorQ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @glemaitre, this will certainly be a nice addition!
Here are a couple of comments.

Comment thread doc/modules/learning_curve.rst Outdated
Comment thread doc/whats_new/v1.3.rst Outdated
Comment thread sklearn/model_selection/_plot.py Outdated
@glemaitre
glemaitre force-pushed the validation_curve_display branch from ebec90b to c1d496c Compare February 2, 2023 09:24
@jeremiedbb jeremiedbb added this to the 1.3 milestone Feb 28, 2023
>>> from sklearn.model_selection import validation_curve
>>> from sklearn.datasets import load_iris
>>> from sklearn.linear_model import Ridge
>>> from sklearn.svm import SVC

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here is that we used a regressor for a classification problem.

@jeremiedbb jeremiedbb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick first pass.

Comment thread sklearn/model_selection/_plot.py Outdated
Comment thread examples/model_selection/plot_validation_curve.py
Comment thread sklearn/model_selection/_plot.py Outdated
Comment thread doc/whats_new/v1.3.rst Outdated
@lorentzenchr

Copy link
Copy Markdown
Member

exploit_incremental_learning should be better documented. It is not clear to me which estimator supports this.

@jeremiedbb

jeremiedbb commented Jun 12, 2023

Copy link
Copy Markdown
Member

exploit_incremental_learning should be better documented. It is not clear to me which estimator supports this.

This is a parameter of learning_curve, but this PR is about adding a display for validation_curve. I think a dedicated issue/Pr is more appropriate.

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another pass. Otherwise LGTM.

Comment thread sklearn/utils/tests/test_plotting.py Outdated
Comment thread sklearn/utils/tests/test_plotting.py Outdated
Comment thread sklearn/utils/_plotting.py Outdated
Comment thread sklearn/utils/tests/test_plotting.py
Comment thread sklearn/utils/tests/test_plotting.py Outdated
Comment thread sklearn/utils/tests/test_plotting.py
Comment thread sklearn/utils/_plotting.py Outdated
Comment thread doc/modules/learning_curve.rst Outdated
Comment thread doc/modules/learning_curve.rst
Comment thread doc/modules/learning_curve.rst Outdated

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More feedback:

Comment thread examples/model_selection/plot_validation_curve.py Outdated
Comment thread examples/model_selection/plot_validation_curve.py Outdated
Comment thread sklearn/model_selection/_plot.py
glemaitre and others added 6 commits June 14, 2023 11:46
Co-authored-by: Olivier Grisel <[email protected]>
Co-authored-by: Jérémie du Boisberranger <[email protected]>
Co-authored-by: Olivier Grisel <[email protected]>
Co-authored-by: Jérémie du Boisberranger <[email protected]>
Co-authored-by: Jérémie du Boisberranger <[email protected]>
@glemaitre

Copy link
Copy Markdown
Member Author

This is a parameter of learning_curve, but this PR is about adding a display for validation_curve. I think a dedicated issue/Pr is more appropriate.

Fine doing this in another PR. We also need to improve the learning_curve documentation then because it is just a copy paste from this documentation.

Comment thread sklearn/model_selection/_plot.py Outdated
Comment thread sklearn/model_selection/_plot.py Outdated
Comment thread sklearn/model_selection/_plot.py Outdated
Comment thread sklearn/model_selection/_plot.py Outdated
Comment thread sklearn/model_selection/_plot.py Outdated
Comment thread sklearn/model_selection/_plot.py Outdated
Comment thread sklearn/utils/_plotting.py Outdated
Comment thread doc/whats_new/v1.3.rst Outdated
Comment on lines +58 to +59
train and test curves to be consistent with
:class:`model_selection.ValidationCurveDisplay`. You can set `score_type="test"` to

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The motivation is more that it's a better default behavior for the typical use cases, rather than consistency

Comment thread doc/modules/learning_curve.rst Outdated
Comment thread doc/modules/learning_curve.rst Outdated
Comment thread doc/modules/learning_curve.rst
Comment thread doc/modules/learning_curve.rst Outdated

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the above suggestions and the following are addressed, LGTM!

Comment thread doc/whats_new/v1.3.rst Outdated
glemaitre and others added 3 commits June 14, 2023 17:50
@jeremiedbb
jeremiedbb enabled auto-merge (squash) June 14, 2023 16:26
@jeremiedbb
jeremiedbb merged commit 8cac52f into scikit-learn:main Jun 14, 2023
@ogrisel

ogrisel commented Jun 15, 2023

Copy link
Copy Markdown
Member

Thanks @glemaitre and @jeremiedbb!

REDVM pushed a commit to REDVM/scikit-learn that referenced this pull request Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants