class_docstr: BaseEnsemble class.
  
  Core ensemble class methods used to add ensemble layers and manipulate
  parameters.
  
  Parameters
  ----------
  model_selection: bool (default=False)
      Whether to use the ensemble in model selection mode. If ``True``,
      this will alter the ``transform`` method. When calling ``transform``
      on new data, the ensemble will call ``predict``, while calling
      ``transform`` with the training data reproduces predictions from the
      ``fit`` call. Hence the ensemble can be used as a pure transformer
      in a preprocessing pipeline passed to the :class:`Evaluator`, as
      training folds are faithfully reproduced as during a ``fit``call and
      test folds are transformed with the ``predict`` method.
  
  samples_size: int (default=20)
      size of training set sample
      (``[min(sample_size, X.size[0]), min(X.size[1], sample_size)]``
  
  shuffle: bool (default=False)
      whether to shuffle input data during fit calls
  
  random_state: bool (default=False)
      random seed.
  
  scorer: obj, optional
      scorer function
  
  verbose: bool, optional
      verbosity
  
  samples_size: int (default=20)
      size of training set sample
      (``[min(sample_size, X.size[0]), min(X.size[1], sample_size)]``
class_docstr_tok: ["BaseEnsemble","class",".","Core","ensemble","class","methods","used","to","add","ensemble","layers","and","manipulate","parameters",".","Parameters","--","--","--","--","--","model_selection",":","bool","(","default=False",")","Whether","to","use","the","ensemble","in","model","selection","mode",".","If","``","True","``",",","this","will","alter","the","``","transform","``","method",".","When","calling","``","transform","``","on","new","data",",","the","ensemble","will","call","``","predict","``",",","while","calling","``","transform","``","with","the","training","data","reproduces","predictions","from","the","``","fit","``","call",".","Hence","the","ensemble","can","be","used","as","a","pure","transformer","in","a","preprocessing","pipeline","passed","to","the",":","class",":","`","Evaluator","`",",","as","training","folds","are","faithfully","reproduced","as","during","a","``","fit","``","call","and","test","folds","are","transformed","with","the","``","predict","``","method",".","samples_size",":","int","(","default=20",")","size","of","training","set","sample","(","``","[","min","(","sample_size",",","X.size","[","0","]",")",",","min","(","X.size","[","1","]",",","sample_size",")","]","``","shuffle",":","bool","(","default=False",")","whether","to","shuffle","input","data","during","fit","calls","random_state",":","bool","(","default=False",")","random","seed",".","scorer",":","obj",",","optional","scorer","function","verbose",":","bool",",","optional","verbosity","samples_size",":","int","(","default=20",")","size","of","training","set","sample","(","``","[","min","(","sample_size",",","X.size","[","0","]",")",",","min","(","X.size","[","1","]",",","sample_size",")","]","``"]
docstr: Method for adding a layer.
  
  Parameters
  -----------
  estimators: dict of lists or list of estimators, or `:class:`Layer`.
      Pre-made layer or estimators to construct layer with.
      If ``preprocessing`` is ``None`` or ``list``, ``estimators`` should
      be a ``list``. The list can either contain estimator instances,
      named tuples of estimator instances, or a combination of both. ::
  
          option_1 = [estimator_1, estimator_2]
          option_2 = [("est-1", estimator_1), ("est-2", estimator_2)]
          option_3 = [estimator_1, ("est-2", estimator_2)]
  
      If different preprocessing pipelines are desired, a dictionary
      that maps estimators to preprocessing pipelines must be passed.
      The names of the estimator dictionary must correspond to the
      names of the estimator dictionary. ::
  
          preprocessing_cases = {"case-1": [trans_1, trans_2].
                                 "case-2": [alt_trans_1, alt_trans_2]}
  
          estimators = {"case-1": [est_a, est_b].
                        "case-2": [est_c, est_d]}
  
      The lists for each dictionary entry can be any of ``option_1``,
      ``option_2`` and ``option_3``.
  
  indexer : instance or None (default = None)
      Indexer instance to use. Defaults to the layer class
      indexer with default settings. See :mod:`mlens.base` for details.
  
  preprocessing: dict of lists or list, optional (default = None)
      preprocessing pipelines for given layer. If
      the same preprocessing applies to all estimators, ``preprocessing``
      should be a list of transformer instances. The list can contain the
      instances directly, named tuples of transformers,
      or a combination of both. ::
  
          option_1 = [transformer_1, transformer_2]
          option_2 = [("trans-1", transformer_1),
                      ("trans-2", transformer_2)]
          option_3 = [transformer_1, ("trans-2", transformer_2)]
  
      If different preprocessing pipelines are desired, a dictionary
      that maps preprocessing pipelines must be passed. The names of the
      preprocessing dictionary must correspond to the names of the
      estimator dictionary. ::
  
          preprocessing_cases = {"case-1": [trans_1, trans_2].
                                 "case-2": [alt_trans_1, alt_trans_2]}
  
          estimators = {"case-1": [est_a, est_b].
                        "case-2": [est_c, est_d]}
  
      The lists for each dictionary entry can be any of ``option_1``,
      ``option_2`` and ``option_3``.
  
  **kwargs : optional
      keyword arguments to be passed onto the layer at instantiation.
  
  Returns
  ----------
  self : instance
      Modified instance.
docstr_tok: ["Method","for","adding","a","layer",".","Parameters","--","--","--","--","--","-","estimators",":","dict","of","lists","or","list","of","estimators",",","or","`",":","class",":","`","Layer","`",".","Pre-made","layer","or","estimators","to","construct","layer","with",".","If","``","preprocessing","``","is","``","None","``","or","``","list","``",",","``","estimators","``","should","be","a","``","list","``",".","The","list","can","either","contain","estimator","instances",",","named","tuples","of","estimator","instances",",","or","a","combination","of","both",".",":",":","option_1","=","[","estimator_1",",","estimator_2","]","option_2","=","[","(","``","est-1","''",",","estimator_1",")",",","(","``","est-2","''",",","estimator_2",")","]","option_3","=","[","estimator_1",",","(","``","est-2","''",",","estimator_2",")","]","If","different","preprocessing","pipelines","are","desired",",","a","dictionary","that","maps","estimators","to","preprocessing","pipelines","must","be","passed",".","The","names","of","the","estimator","dictionary","must","correspond","to","the","names","of","the","estimator","dictionary",".",":",":","preprocessing_cases","=","{","``","case-1","''",":","[","trans_1",",","trans_2","]",".","``","case-2","''",":","[","alt_trans_1",",","alt_trans_2","]","}","estimators","=","{","``","case-1","''",":","[","est_a",",","est_b","]",".","``","case-2","''",":","[","est_c",",","est_d","]","}","The","lists","for","each","dictionary","entry","can","be","any","of","``","option_1","``",",","``","option_2","``","and","``","option_3","``",".","indexer",":","instance","or","None","(","default","=","None",")","Indexer","instance","to","use",".","Defaults","to","the","layer","class","indexer","with","default","settings",".","See",":","mod",":","`","mlens.base","`","for","details",".","preprocessing",":","dict","of","lists","or","list",",","optional","(","default","=","None",")","preprocessing","pipelines","for","given","layer",".","If","the","same","preprocessing","applies","to","all","estimators",",","``","preprocessing","``","should","be","a","list","of","transformer","instances",".","The","list","can","contain","the","instances","directly",",","named","tuples","of","transformers",",","or","a","combination","of","both",".",":",":","option_1","=","[","transformer_1",",","transformer_2","]","option_2","=","[","(","``","trans-1","''",",","transformer_1",")",",","(","``","trans-2","''",",","transformer_2",")","]","option_3","=","[","transformer_1",",","(","``","trans-2","''",",","transformer_2",")","]","If","different","preprocessing","pipelines","are","desired",",","a","dictionary","that","maps","preprocessing","pipelines","must","be","passed",".","The","names","of","the","preprocessing","dictionary","must","correspond","to","the","names","of","the","estimator","dictionary",".",":",":","preprocessing_cases","=","{","``","case-1","''",":","[","trans_1",",","trans_2","]",".","``","case-2","''",":","[","alt_trans_1",",","alt_trans_2","]","}","estimators","=","{","``","case-1","''",":","[","est_a",",","est_b","]",".","``","case-2","''",":","[","est_c",",","est_d","]","}","The","lists","for","each","dictionary","entry","can","be","any","of","``","option_1","``",",","``","option_2","``","and","``","option_3","``",".","*","*","kwargs",":","optional","keyword","arguments","to","be","passed","onto","the","layer","at","instantiation",".","Returns","--","--","--","--","--","self",":","instance","Modified","instance","."]
code: def add(self, estimators, indexer, preprocessing=None, **kwargs):
      """Method for adding a layer.
  
      Parameters
      -----------
      estimators: dict of lists or list of estimators, or `:class:`Layer`.
          Pre-made layer or estimators to construct layer with.
          If ``preprocessing`` is ``None`` or ``list``, ``estimators`` should
          be a ``list``. The list can either contain estimator instances,
          named tuples of estimator instances, or a combination of both. ::
  
              option_1 = [estimator_1, estimator_2]
              option_2 = [("est-1", estimator_1), ("est-2", estimator_2)]
              option_3 = [estimator_1, ("est-2", estimator_2)]
  
          If different preprocessing pipelines are desired, a dictionary
          that maps estimators to preprocessing pipelines must be passed.
          The names of the estimator dictionary must correspond to the
          names of the estimator dictionary. ::
  
              preprocessing_cases = {"case-1": [trans_1, trans_2].
                                     "case-2": [alt_trans_1, alt_trans_2]}
  
              estimators = {"case-1": [est_a, est_b].
                            "case-2": [est_c, est_d]}
  
          The lists for each dictionary entry can be any of ``option_1``,
          ``option_2`` and ``option_3``.
  
      indexer : instance or None (default = None)
          Indexer instance to use. Defaults to the layer class
          indexer with default settings. See :mod:`mlens.base` for details.
  
      preprocessing: dict of lists or list, optional (default = None)
          preprocessing pipelines for given layer. If
          the same preprocessing applies to all estimators, ``preprocessing``
          should be a list of transformer instances. The list can contain the
          instances directly, named tuples of transformers,
          or a combination of both. ::
  
              option_1 = [transformer_1, transformer_2]
              option_2 = [("trans-1", transformer_1),
                          ("trans-2", transformer_2)]
              option_3 = [transformer_1, ("trans-2", transformer_2)]
  
          If different preprocessing pipelines are desired, a dictionary
          that maps preprocessing pipelines must be passed. The names of the
          preprocessing dictionary must correspond to the names of the
          estimator dictionary. ::
  
              preprocessing_cases = {"case-1": [trans_1, trans_2].
                                     "case-2": [alt_trans_1, alt_trans_2]}
  
              estimators = {"case-1": [est_a, est_b].
                            "case-2": [est_c, est_d]}
  
          The lists for each dictionary entry can be any of ``option_1``,
          ``option_2`` and ``option_3``.
  
      **kwargs : optional
          keyword arguments to be passed onto the layer at instantiation.
  
      Returns
      ----------
      self : instance
          Modified instance.
      """
      lyr = self._build_layer(
          estimators, indexer, preprocessing, **kwargs
      )
  
      self.layers.append(clone(lyr))
      setattr(self, lyr.name.replace("-", "_"), lyr)
  
      self._backend.push(lyr)
      return self
  
imports: from __future__ import division, print_function, with_statement
  from abc import ABCMeta, abstractmethod
  import warnings
  from ..None import config
  from ..parallel import Layer, ParallelProcessing, make_group
  from ..parallel.base import BaseStacker
  from ..externals.sklearn.validation import check_random_state
  from ..utils import check_ensemble_build, print_time, safe_print, IdTrain, format_name
  from ..utils.exceptions import LayerSpecificationWarning, NotFittedError, NotInitializedError
  from ..metrics import Data
  from ..externals.sklearn.base import BaseEstimator, clone
label_desc: Use image node_id 2 for calling the BaseEnsemble obj's underlying member method code with example usage: obj.add(estimators, indexer, preprocessing) and returns: self