Repository: scikit-learn/scikit-learn
Pull request: FIX #11215 : Changing return in docstring to yields for generator functions
#### Reference Issues/PRs

Fixes #11215. 

#### What does this implement/fix? Explain your changes.

I changed all the docstrings for generator functions to say `Yields` instead `Returns`. 

#### Any other comments?

First OSS contribution :) 🥇 


Problem statement:
GroupShuffelSplit `return` doc is incorrect
#### Description
In the documentation, the `return` part of the split method on `sklearn.model_selection.GroupShuffleSplit`  is incorrect

Doc says the split method returns:
```
train : ndarray
     The training set indices for that split.

test : ndarray
     The testing set indices for that split.
```

Whilst it returns a generator.

[Not sure if small doc issues should be raised or directly submitted as pull request, apologies if I did it wrong]

Hints from issue discussion:
This is a problem throughout the module. We now use a version of numpydoc that supports a Yields section.

A PR is welcome (and would have been welcome without first opening an issue). Thanks!
Great, thanks @jnothman , I'll submit a PR

Commit message: Changing return in docstring to yields for generator functions

Patch to review:
diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py
index 866cb4cc53aa8..583be341b80f8 100644
--- a/sklearn/model_selection/_split.py
+++ b/sklearn/model_selection/_split.py
@@ -76,7 +76,7 @@ def split(self, X, y=None, groups=None):
             Group labels for the samples used while splitting the dataset into
             train/test set.
 
-        Returns
+        Yields
         -------
         train : ndarray
             The training set indices for that split.
@@ -301,7 +301,7 @@ def split(self, X, y=None, groups=None):
             Group labels for the samples used while splitting the dataset into
             train/test set.
 
-        Returns
+        Yields
         -------
         train : ndarray
             The training set indices for that split.
@@ -734,7 +734,7 @@ def split(self, X, y=None, groups=None):
         groups : array-like, with shape (n_samples,), optional
             Always ignored, exists for compatibility.
 
-        Returns
+        Yields
         -------
         train : ndarray
             The training set indices for that split.
@@ -1006,7 +1006,7 @@ def split(self, X, y=None, groups=None):
             Group labels for the samples used while splitting the dataset into
             train/test set.
 
-        Returns
+        Yields
         -------
         train : ndarray
             The training set indices for that split.
@@ -1182,7 +1182,7 @@ def split(self, X, y=None, groups=None):
             Group labels for the samples used while splitting the dataset into
             train/test set.
 
-        Returns
+        Yields
         -------
         train : ndarray
             The training set indices for that split.
@@ -1763,7 +1763,7 @@ def split(self, X=None, y=None, groups=None):
         groups : object
             Always ignored, exists for compatibility.
 
-        Returns
+        Yields
         -------
         train : ndarray
             The training set indices for that split.
@@ -1847,7 +1847,7 @@ def split(self, X=None, y=None, groups=None):
         groups : object
             Always ignored, exists for compatibility.
 
-        Returns
+        Yields
         -------
         train : ndarray
             The training set indices for that split.


Code review comments:
diff_hunk: @@ -76,7 +76,7 @@ def split(self, X, y=None, groups=None):
             Group labels for the samples used while splitting the dataset into
             train/test set.
 
-        Returns
+        Yields
         -------
path: sklearn/model_selection/_split.py
text: @user1:
You need to remove the last `-` to match the section length. 

@author:
👍