class_docstr: Base Index class.
  
  Specification of indexer-wide methods and attributes that we can always
  expect to find in any indexer. Helps to provide a uniform interface
  during parallel estimation.
class_docstr_tok: ["Base","Index","class",".","Specification","of","indexer-wide","methods","and","attributes","that","we","can","always","expect","to","find","in","any","indexer",".","Helps","to","provide","a","uniform","interface","during","parallel","estimation","."]
docstr: Method for constructing the index generator.
  
  This should be modified by each indexer class to build the desired
  index. Currently, the Default is the standard K-Fold as this method
  is returned by Subset-based indexer when number of subsets is ``1``.
  
  Returns
  -------
  iterable :
      a generator of ``train_index, test_index``.
docstr_tok: ["Method","for","constructing","the","index","generator",".","This","should","be","modified","by","each","indexer","class","to","build","the","desired","index",".","Currently",",","the","Default","is","the","standard","K-Fold","as","this","method","is","returned","by","Subset-based","indexer","when","number","of","subsets","is","``","1","``",".","Returns","--","--","--","-","iterable",":","a","generator","of","``","train_index",",","test_index","``","."]
code: def _gen_indices(self):
      """Method for constructing the index generator.
  
      This should be modified by each indexer class to build the desired
      index. Currently, the Default is the standard K-Fold as this method
      is returned by Subset-based indexer when number of subsets is ``1``.
  
      Returns
      -------
      iterable :
          a generator of ``train_index, test_index``.
      """
      n_samples = self.n_samples
      folds = self.folds
  
      if folds == 1:
          # Return the full index as both training and test set
          yield ((0, n_samples),), (0, n_samples)
      else:
          # Get the length of the test sets
          tei_len = partition(n_samples, folds)
  
          last = 0
          for size in tei_len:
              # Test set
              tei_start, tei_stop = last, last + size
              tei = (tei_start, tei_stop)
  
              # Train set
              tri_start_below, tri_stop_below = 0, tei_start
              tri_start_above, tri_stop_above = tei_stop, n_samples
  
              tri = prune_train(
                  tri_start_below,
                  tri_stop_below,
                  tri_start_above,
                  tri_stop_above,
              )
  
              yield tri, tei
              last = tei_stop
  
imports: from __future__ import division
  from abc import abstractmethod
  import numpy
  from ..externals.sklearn.base import BaseEstimator
label_desc: Use image node_id 3 for calling the BaseIndex obj's underlying member method code with example usage: obj._gen_indices() without return types