original_docstring: Returns the class prediction and the confidence
  
          input_data: Input data to be predicted
  
          
docstring: Returns the class prediction and the confidence
  input_data: Input data to be predicted
docstring_tokens: Returns the class prediction and the confidence input_data : Input data to be predicted
code: def forecast(self, input_data=None):
          """Returns the class prediction and the confidence
  
          input_data: Input data to be predicted
  
          """
          if not input_data:
              forecasts = {}
              for field_id, value in list(self._forecast.items()):
                  forecasts[field_id] = []
                  for forecast in value:
                      local_forecast = {}
                      local_forecast.update( \
                          {"point_forecast": forecast["point_forecast"]})
                      local_forecast.update( \
                          {"model": forecast["model"]})
                      forecasts[field_id].append(local_forecast)
              return forecasts
  
          # Checks and cleans input_data leaving only the fields used as
          # objective fields in the model
          norm_input_data = self.filter_objectives( \
              input_data)
  
          # filter submodels: filtering the submodels in the time-series
          # model to be used in the prediction
          filtered_submodels = {}
          for field_id, field_input in list(norm_input_data.items()):
              filter_info = field_input.get("ets_models", {})
              if not filter_info:
                  filter_info = DEFAULT_SUBMODEL
              filtered_submodels[field_id] = filter_submodels( \
                  self.ets_models[field_id], filter_info)
  
          forecasts = {}
          for field_id, submodels in list(filtered_submodels.items()):
              forecasts[field_id] = compute_forecasts(submodels, \
                  norm_input_data[field_id]["horizon"])
  
          return forecasts
code_tokens: def forecast ( self , input_data = None ) : if not input_data : forecasts = { } for field_id , value in list ( self . _forecast . items ( ) ) : forecasts [ field_id ] = [ ] for forecast in value : local_forecast = { } local_forecast . update ( { "point_forecast" : forecast [ "point_forecast" ] } ) local_forecast . update ( { "model" : forecast [ "model" ] } ) forecasts [ field_id ] . append ( local_forecast ) return forecasts norm_input_data = self . filter_objectives ( input_data ) filtered_submodels = { } for field_id , field_input in list ( norm_input_data . items ( ) ) : filter_info = field_input . get ( "ets_models" , { } ) if not filter_info : filter_info = DEFAULT_SUBMODEL filtered_submodels [ field_id ] = filter_submodels ( self . ets_models [ field_id ] , filter_info ) forecasts = { } for field_id , submodels in list ( filtered_submodels . items ( ) ) : forecasts [ field_id ] = compute_forecasts ( submodels , norm_input_data [ field_id ] [ "horizon" ] ) return forecasts
short_docstring: Returns the class prediction and the confidence
  input_data: Input data to be predicted
short_docstring_tokens: Returns the class prediction and the confidence input_data : Input data to be predicted
comment: """Returns the class prediction and the confidence
  
          input_data: Input data to be predicted
  
          """$SEP$# Checks and cleans input_data leaving only the fields used as$SEP$# objective fields in the model$SEP$# filter submodels: filtering the submodels in the time-series$SEP$# model to be used in the prediction