DOC Clarify LeaveOneGroupOut#24159
Merged
glemaitre merged 3 commits intoscikit-learn:mainfrom Aug 24, 2022
Merged
Conversation
thomasjpfan
reviewed
Aug 10, 2022
doc/modules/cross_validation.rst
Outdated
| cross-validation folds. | ||
| :class:`LeaveOneGroupOut` is a cross-validation scheme where each split holds | ||
| out samples belonging to one specific group. Group information is | ||
| provided via an array of integers that encode the group of each sample. |
Member
There was a problem hiding this comment.
I do not think the groups need to be integers:
Suggested change
| provided via an array of integers that encode the group of each sample. | |
| provided via an array that encodes the group of each sample. |
Code example:
import numpy as np
from sklearn.model_selection import LeaveOneGroupOut
X = np.array([[1, 2], [3, 4], [5, 6], [7, 8]])
y = np.array([1, 2, 1, 2])
groups = np.array(["one", "one", "two", "two"])
logo = LeaveOneGroupOut()
for train_index, test_index in logo.split(X, y, groups):
print(groups[train_index], groups[test_index])
sklearn/model_selection/_split.py
Outdated
| Provides train/test indices to split data such that each training set is | ||
| comprised of all samples except ones belonging to one specific group. | ||
| Arbitrary domain specific group information is provided via an array of | ||
| integers that encode the group of each sample. |
Member
There was a problem hiding this comment.
Same here regarding integers.
Member
Author
|
Thanks! Should have checked and not assumed the old wording was correct! |
Member
|
Thanks @lucyleeow |
glemaitre
pushed a commit
to glemaitre/scikit-learn
that referenced
this pull request
Sep 12, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
closes #24148
What does this implement/fix? Explain your changes.
Removes the use of the term 'third party' in LeaveOneGroup out description and fixes a typo.
Happy to change wording
Any other comments?