class_docstr: Constructs a weighted ensemble using the greedy Ensemble Selection algorithm.
class_docstr_tok: ["Constructs","a","weighted","ensemble","using","the","greedy","Ensemble","Selection","algorithm","."]
code: def predict(
      self, data: Dict[str, TimeSeriesDataFrame], **kwargs
  ) -> TimeSeriesDataFrame:
      if set(data.keys()) != set(self.model_names):
          raise ValueError(
              f"Set of models given for prediction in {self.name} differ from those provided during initialization."
          )
      for model_name, model_pred in data.items():
          if model_pred is None:
              raise RuntimeError(
                  f"{self.name} cannot predict because base model {model_name} failed."
              )
  
      # Make sure that all predictions have same shape
      assert len(set(pred.shape for pred in data.values())) == 1
  
      return sum(
          data[model_name] * weight
          for model_name, weight in self.model_to_weight.items()
      )
  
imports: import copy
  import logging
  import pprint
  from typing import Dict, List, Optional
  import numpy
  import autogluon.core
  from autogluon.common.utils.log_utils import set_logger_verbosity
  from autogluon.core.models.greedy_ensemble.ensemble_selection import EnsembleSelection
  from autogluon.timeseries import TimeSeriesDataFrame
  from autogluon.timeseries.metrics import TimeSeriesScorer
  from autogluon.timeseries.models.ensemble import AbstractTimeSeriesEnsembleModel
  from autogluon.timeseries.utils.datetime import get_seasonality
label_desc: Use image node_id 5 for calling the TimeSeriesGreedyEnsemble obj's underlying member method code with example usage: obj.predict(data) and returns: sum