Generate indices to split data into training and test set. Parameters ---------- X : array-like of shape (n_samples, n_features) Training data, where `n_samples` is the number of samples and `n_features` is the number of features. y : array-l
(self, X, y=None, groups=None)
| 60 | """Mixin for splitters that do not support Groups.""" |
| 61 | |
| 62 | def split(self, X, y=None, groups=None): |
| 63 | """Generate indices to split data into training and test set. |
| 64 | |
| 65 | Parameters |
| 66 | ---------- |
| 67 | X : array-like of shape (n_samples, n_features) |
| 68 | Training data, where `n_samples` is the number of samples |
| 69 | and `n_features` is the number of features. |
| 70 | |
| 71 | y : array-like of shape (n_samples,), default=None |
| 72 | The target variable for supervised learning problems. |
| 73 | |
| 74 | groups : array-like of shape (n_samples,), default=None |
| 75 | Always ignored, exists for API compatibility. |
| 76 | |
| 77 | Yields |
| 78 | ------ |
| 79 | train : ndarray |
| 80 | The training set indices for that split. |
| 81 | |
| 82 | test : ndarray |
| 83 | The testing set indices for that split. |
| 84 | """ |
| 85 | if groups is not None: |
| 86 | warnings.warn( |
| 87 | f"The groups parameter is ignored by {self.__class__.__name__}", |
| 88 | UserWarning, |
| 89 | ) |
| 90 | return super().split(X, y, groups=groups) |
| 91 | |
| 92 | |
| 93 | class GroupsConsumerMixin(_MetadataRequester): |