title: StratifiedShuffleSplit: ValueError: The least populated class in y has only 1 member, which is too few.
body: <p>I'm using the StratifiedShuffleSplit cross validator for predicting the house prices in the Boston dataset. When I run the below sample code.</p>
  
  <pre><code>def fit_model_S(labels, features,step, clf,parameters):
    cv = StratifiedShuffleSplit(n_splits=2,test_size=0.10, random_state = 42)
    print (cv)
    for train_index, test_index in cv.split(features,labels):
      labels_train, labels_test = labels[train_index], labels[test_index]
      features_train, features_test = features[train_index], features[test_index]
  </code></pre>
  
  <p>I get the below error. The code works with ShuffleSplit.Does this mean that StratifiedShuffleSplit cannot be used with numeric labels.</p>
  
  <pre><code>---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-141-b290147edcbf&gt; in &lt;module&gt;()
       33 dt_steps = [('decision', clf)]
       34 
  ---&gt; 35 fit_model_S(labels, features,dt_steps,clf,parameters4)  
       36 
       37 
  
  &lt;ipython-input-141-b290147edcbf&gt; in fit_model_S(labels, features, step, clf, parameters)
        8     cv = StratifiedShuffleSplit(n_splits=2,test_size=0.10, random_state = 42)
        9     print (cv)
  ---&gt; 10     for train_index, test_index in cv.split(features,labels):
       11 
       12         labels_train, labels_test = labels[train_index], labels[test_index]
  
  C:\ProgramData\Anaconda3\lib\site-packages\sklearn\model_selection\_split.py in split(self, X, y, groups)
     1194         """
     1195         X, y, groups = indexable(X, y, groups)
  -&gt; 1196         for train, test in self._iter_indices(X, y, groups):
     1197             yield train, test
     1198 
  
  C:\ProgramData\Anaconda3\lib\site-packages\sklearn\model_selection\_split.py in _iter_indices(self, X, y, groups)
     1535         class_counts = np.bincount(y_indices)
     1536         if np.min(class_counts) &lt; 2:
  -&gt; 1537             raise ValueError("The least populated class in y has only 1"
     1538                              " member, which is too few. The minimum"
     1539                              " number of groups for any class cannot"
  
  ValueError: The least populated class in y has only 1 member, which is too few. The minimum number of groups for any class cannot be less than 2.
  </code></pre>
  
  <p>Dataset sample as below.</p>
  
  <pre><code>      RM  LSTAT  PTRATIO      MEDV
  0  6.575   4.98     15.3  504000.0
  1  6.421   9.14     17.8  453600.0
  2  7.185   4.03     17.8  728700.0
  3  6.998   2.94     18.7  701400.0
  4  7.147   5.33     18.7  760200.0
  </code></pre>
  
  <p>The MEDV is the label in this case.</p>