class_docstr: Temporal ensemble class.
  
  The temporal ensemble class uses a time series cross-validation
  strategy to create training and test folds that preserve temporal
  ordering in the data. The cross validation strategy is unrolled
  through time. For instance:
  
  ====  =================  ==========
  fold  train obs          test obs
  ====  =================  ==========
  0     0, 1, 2, 3         4
  1     0, 1, 2, 3, 4      5
  2     0, 1, 2, 3, 4, 5   6
  ====  =================  ==========
  
  Different estimators in the ensemble can operate on different time scales,
  allow efficient combinations of different temporal patterns in one model.
  
  See Also
  --------
  :class:`SuperLearner`, :class:`BlendEnsemble`, :class:`SequentialEnsemble`
  
  
  .. note :: All parameters can be overriden in the :attr:`add` method unless
      otherwise specified. Notably, the ``backend`` and ``n_jobs`` cannot
      be altered in the :attr:`add` method.
  
  Parameters
  ----------
  step_size : int (default=1)
      number of samples to use in each test fold. The final window
      size may be smaller if too few observations remain.
  
  burn_in : int (default=None)
      number of samples to use for first training fold. These observations
      will be dropped from the output. Defaults to ``step_size``.
  
  window: int (default=None)
      number of previous samples to use in each training fold, except first
      which is determined by ``burn_in``. If ``None``, will use all previous
      observations.
  
  lag: int (default=0)
      distance between the most recent training point in the training fold and
      the first test point. For ``lag>0``, the training fold and the test fold
      will not be contiguous.
  
  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)
      Degree of parallel processing. Set to -1 for maximum parallelism and
      1 for sequential processing. Cannot be overriden in the :attr:`add` method.
  
  backend : str or object (default = 'threading')
      backend infrastructure to use during call to
      :class:`mlens.externals.joblib.Parallel`. See Joblib for further
      documentation. To set global backend, set ``mlens.config._BACKEND``.
      Cannot be overriden in the :attr:`add` method.
  
  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 sklearn.linear_model import LinearRegression
  >>> from mlens.ensemble import TemporalEnsemble
  >>> import numpy as np
  >>>
  >>> x = np.linspace(0, 1, 100)
  >>> y = x[1:]
  >>> x = x[:-1]
  >>> x = x.reshape(-1, 1)
  >>>
  >>> ens = TemporalEnsemble(window=1)
  >>> ens.add(LinearRegression())
  >>>
  >>> ens.fit(x, y)
  >>> p = ens.predict(x)
  >>>
  >>>
  >>> print("{:5} | {:5}".format('pred', 'truth'))
  >>> for i in range(5, 10):
  ...     print("{:.3f} | {:.3f}".format(p[i], y[i]))
  >>>
  pred  | truth
  0.061 | 0.061
  0.071 | 0.071
  0.081 | 0.081
  0.091 | 0.091
  0.101 | 0.101
docstr: Meta Learner.
  
  Meta learner to be used for final predictions.
  
  Parameters
  ----------
  estimator : instance
      estimator instance.
  
  **kwargs : optional
      optional keyword arguments.
docstr_tok: ["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(estimators=estimator, meta=True, **kwargs)
  
imports: from __future__ import division
  from .base import BaseEnsemble
  from ..index import TemporalIndex, FullIndex
label_desc: Use image node_id 2 for calling the TemporalEnsemble obj's underlying member method code with example usage: obj.add_meta(estimator) and returns: self