docstr: Average the `forecasting_models` predictions, component-wise
docstr_tok: ["Average","the","`","forecasting_models","`","predictions",",","component-wise"]
code: def ensemble(
      self,
      predictions: Union[TimeSeries, Sequence[TimeSeries]],
      series: Union[TimeSeries, Sequence[TimeSeries]],
      num_samples: int = 1,
      predict_likelihood_parameters: bool = False,
  ) -> Union[TimeSeries, Sequence[TimeSeries]]:
      """Average the `forecasting_models` predictions, component-wise"""
      raise_if(
          predict_likelihood_parameters
          and not self.supports_likelihood_parameter_prediction,
          "`predict_likelihood_parameters=True` is supported only if all the `forecasting_models` "
          "are probabilistic and fitting the same likelihood.",
          logger,
      )
  
      if isinstance(predictions, Sequence):
          return [
              self._target_average(p, ts)
              if not predict_likelihood_parameters
              else self._params_average(p, ts)
              for p, ts in zip(predictions, series)
          ]
      else:
          return (
              self._target_average(predictions, series)
              if not predict_likelihood_parameters
              else self._params_average(predictions, series)
          )
  
imports: from typing import List, Optional, Sequence, Union
  import numpy
  from darts.logging import get_logger, raise_if, raise_if_not
  from darts.models.forecasting.ensemble_model import EnsembleModel
  from darts.models.forecasting.forecasting_model import ForecastingModel, LocalForecastingModel
  from darts.timeseries import TimeSeries
label_desc: Use image node_id 3 for calling the NaiveEnsembleModel obj's underlying member method code with example usage: obj.ensemble(predictions, series, num_samples, predict_likelihood_parameters) and returns: unknown, unknown