class_docstr: Class for getting data.
class_docstr_tok: ["Class","for","getting","data","."]
docstr: Build ground truth for each fold.
code: def _folded_ests(self, X, y, subsets=1):
      """Build ground truth for each fold."""
      ests, prep, n_ests, attr, labels = self._set_up_est(y)
  
      t = [t for _, t in self.indexer.generate(X, True)]
      t = np.unique(np.hstack(t))
      t.sort()
  
      weights = []
      F = np.zeros((len(t), n_ests * subsets * labels), dtype=np.float)
  
      col_id = {}
      col_ass = 0
  
      # Sort at every occasion
      vps = [(c, e[0]) for c in prep.keys() for e in ests[c]]
  
      for meta_key in sorted(vps):
          key, est_name = meta_key
          est = dict(ests[key])[est_name]
          for i, (tri, tei) in enumerate(
              self.indexer.generate(X, True)
          ):
              if subsets > 1:
                  i = i // self.indexer.folds
              else:
                  i = 0
  
              if "%s-%s-%s" % (i, key, est_name) not in col_id:
                  col_id["%s-%s-%s" % (i, key, est_name)] = col_ass
                  col_ass += labels
  
              xtrain = X[tri]
              xtest = X[tei]
  
              # Transform inputs
              for _, tr in prep[key]:
                  t = clone(tr)
                  xtrain = t.fit_transform(xtrain)
                  xtest = t.transform(xtest)
  
              # Fit estimator
              e = clone(est).fit(xtrain, y[tri])
              w = e.coef_
              weights.append(w)
  
              # Get out-of-sample predictions
              p = getattr(e, attr)(xtest)
  
              rebase = X.shape[0] - F.shape[0]
              fix = tei - rebase
  
              if labels == 1:
                  F[fix, col_id["%s-%s-%s" % (i, key, est_name)]] = p
              else:
                  c = col_id["%s-%s-%s" % (i, key, est_name)]
                  F[np.ix_(fix, np.arange(c, c + labels))] = p
  
      return F, weights
  
imports: from __future__ import division, print_function, with_statement
  import os
  import shutil
  import warnings
  from abc import abstractmethod
  import numpy
  from ..utils.utils import pickle_save, pickle_load
  from ..utils.dummy import OLS, LogisticRegression, Scale
  from ..externals.sklearn.base import clone
  from ..index import INDEXERS
  from ..ensemble.base import Sequential
  from ..estimators import LayerEnsemble
  from ..parallel import ParallelProcessing, Learner, Transformer, Layer, make_group, Pipeline
label_desc: Use image node_id 5 for calling the Data obj's underlying member method code with example usage: obj._folded_ests(X, y, subsets) and returns: F,  weights