Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH allow to return train/test split indices in cross_validate #25659

Merged

Conversation

glemaitre
Copy link
Member

The first step towards #21211

This PR expose return_indices allowing us to get the train/test split used during the cross-validation using the cross_validate function.

It will be useful when:

@glemaitre
Copy link
Member Author

ping @thomasjpfan and @ogrisel that might be interested to review this feature.

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Thank you for the PR! The feature looks reasonable to me.

doc/modules/cross_validation.rst Outdated Show resolved Hide resolved
sklearn/model_selection/_validation.py Outdated Show resolved Hide resolved
sklearn/model_selection/_validation.py Outdated Show resolved Hide resolved
sklearn/model_selection/_validation.py Outdated Show resolved Hide resolved
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Minor comments about testing and docstrings. Otherwise LGTM

sklearn/model_selection/_validation.py Outdated Show resolved Hide resolved
sklearn/model_selection/tests/test_validation.py Outdated Show resolved Hide resolved
Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

LGTM with 2 suggestions:

sklearn/model_selection/tests/test_validation.py Outdated Show resolved Hide resolved
sklearn/model_selection/_validation.py Outdated Show resolved Hide resolved
@ogrisel ogrisel enabled auto-merge (squash) March 9, 2023 08:46
@ogrisel
Copy link
Member

ogrisel commented Mar 9, 2023

I synced with main via github and marked as auto-merge.

@glemaitre glemaitre disabled auto-merge March 9, 2023 10:35
@glemaitre glemaitre merged commit c66787a into scikit-learn:main Mar 9, 2023
@glemaitre
Copy link
Member Author

Since @ogrisel did both sync and add the auto-merge then the auto-merge does not work because @ogrisel was the last person to push in the branch.

I just manually merge then.

@ogrisel
Copy link
Member

ogrisel commented Mar 9, 2023

Hahaha, this is annoying..

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.

3 participants