class_docstr: Sequential Ensemble class.
  
  The Sequential Ensemble class allows users to build ensembles with
  different classes of layers. The type of layer and its parameters are
  specified when added to the ensemble. See respective ensemble class for
  details on parameters.
  
  See Also
  --------
  :class:`BlendEnsemble`, :class:`Subsemble`, :class:`SuperLearner`
  
  Parameters
  ----------
  shuffle : bool (default = False)
      whether to shuffle data before before processing each layer.
      For greater control, specify ``shuffle`` when adding the layer.
  
  random_state : int (default = None)
      random seed if shuffling inputs.
  
  scorer : object (default = None)
      scoring function. If a function is provided, base estimators will be
      scored on the training set assembled for fitting the meta estimator.
      Since those predictions are out-of-sample, the scores represent valid
      test scores. The scorer should be a function that accepts an array of
      true values and an array of predictions: ``score = f(y_true, y_pred)``.
  
  raise_on_exception : bool (default = True)
      whether to issue warnings on soft exceptions or raise error.
      Examples include lack of layers, bad inputs, and failed fit of an
      estimator in a layer. If set to ``False``, warnings are issued instead
      but estimation continues unless exception is fatal. Note that this
      can result in unexpected behavior unless the exception is anticipated.
  
  verbose : int or bool (default = False)
      level of verbosity.
  
          * ``verbose = 0`` silent (same as ``verbose = False``)
  
          * ``verbose = 1`` messages at start and finish (same as
            ``verbose = True``)
  
          * ``verbose = 2`` messages for each layer
  
      If ``verbose >= 50`` prints to ``sys.stdout``, else ``sys.stderr``.
      For verbosity in the layers themselves, use ``fit_params``.
  
  n_jobs : int (default = -1)
      number of CPU cores to use for fitting and prediction.
  
  backend : str or object (default = 'threading')
      backend infrastructure to use during call to
      :class:`mlens.externals.joblib.Parallel`. See Joblib for further
      documentation. To change global backend, set
      ``mlens.config._BACKEND``
  
  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.
  
  sample_size: int (default=20)
      size of training set sample
      (``[min(sample_size, X.size[0]), min(X.size[1], sample_size)]``)
  
  Examples
  --------
  >>> from mlens.ensemble import SequentialEnsemble
  >>> from mlens.metrics.metrics import rmse
  >>> from sklearn.datasets import load_boston
  >>> from sklearn.linear_model import Lasso
  >>> from sklearn.svm import SVR
  >>>
  >>> X, y = load_boston(True)
  >>>
  >>> ensemble = SequentialEnsemble()
  >>>
  >>> # Add a subsemble with 5 partitions as first layer
  >>> ensemble.add('subsemble', [SVR(), Lasso()], partitions=10, folds=10)
  >>>
  >>> # Add a super learner as second layer
  >>> ensemble.add('stack', [SVR(), Lasso()], folds=20)
  >>>
  >>> # Specify a meta estimator
  >>> ensemble.add_meta(SVR())
  >>>
  >>> ensemble.fit(X, y)
  >>> preds = ensemble.predict(X)
  >>> rmse(y, preds)
  6.5628...
docstr: Meta Learner.
  
  Meta learner to be used for final predictions.
  
  Parameters
  ----------
  estimator : instance
      estimator instance.
  
  **kwargs : optional
      optional keyword arguments.
code: def add_meta(self, estimator, **kwargs):
      """Meta Learner.
  
      Meta learner to be used for final predictions.
  
      Parameters
      ----------
      estimator : instance
          estimator instance.
  
      **kwargs : optional
          optional keyword arguments.
      """
      return self.add(
          cls="full", estimators=estimator, meta=True, **kwargs
      )
  
file_path: mlens/mlens/ensemble/sequential.py
imports: from __future__ import division
  from .base import BaseEnsemble
  from ..index import INDEXERS
  from ..utils import kwarg_parser
label_desc: Use image node_id 2 for calling the SequentialEnsemble obj's underlying member method code with example usage: obj.add_meta(estimator) and returns: self