class_docstr: The main entry point to create a forecast.
  
  Call the :py:meth:`~greykite.framework.templates.forecaster.Forecaster.run_forecast_config`
  method to create a forecast. It takes a dataset and forecast configuration parameters.
  
  Notes
  -----
  This class can create forecasts using any of the model templates in
  `~greykite.framework.templates.model_templates.ModelTemplateEnum`.
  Model templates provide suitable default values for the available
  forecast estimators depending on the data characteristics.
  
  The model template is selected via the ``config.model_template``
  parameter to :py:meth:`~greykite.framework.templates.forecaster.Forecaster.run_forecast_config`.
  
  To add your own custom algorithms or template classes in our framework,
  pass ``model_template_enum`` and ``default_model_template_name``
  to the constructor.
class_docstr_tok: ["The","main","entry","point","to","create","a","forecast",".","Call","the",":","py",":","meth",":","`","~greykite.framework.templates.forecaster.Forecaster.run_forecast_config","`","method","to","create","a","forecast",".","It","takes","a","dataset","and","forecast","configuration","parameters",".","Notes","--","--","-","This","class","can","create","forecasts","using","any","of","the","model","templates","in","`","~greykite.framework.templates.model_templates.ModelTemplateEnum","`",".","Model","templates","provide","suitable","default","values","for","the","available","forecast","estimators","depending","on","the","data","characteristics",".","The","model","template","is","selected","via","the","``","config.model_template","``","parameter","to",":","py",":","meth",":","`","~greykite.framework.templates.forecaster.Forecaster.run_forecast_config","`",".","To","add","your","own","custom","algorithms","or","template","classes","in","our","framework",",","pass","``","model_template_enum","``","and","``","default_model_template_name","``","to","the","constructor","."]
docstr: Fetches pipeline parameters from the ``df`` and ``config``,
  but does not run the pipeline to generate a forecast.
  
  :py:meth:`~greykite.framework.templates.forecaster.Forecaster.run_forecast_config`
  calls this function and also runs the forecast pipeline.
  
  Available for debugging purposes to check pipeline parameters before
  running a forecast. Sets these attributes for debugging:
  
      - ``pipeline_params`` : the parameters passed to
        :func:`~greykite.framework.pipeline.pipeline.forecast_pipeline`.
      - ``template_class``, ``template`` : the template class used to generate the
        pipeline parameters.
      - ``config`` : the :class:`~greykite.framework.templates.model_templates.ForecastConfig`
        passed as input to template class, to translate into pipeline parameters.
  
  Provides basic validation on the compatibility of ``config.model_template``
  with ``config.model_components_param``.
  
  Parameters
  ----------
  df : `pandas.DataFrame`
      Timeseries data to forecast.
      Contains columns [`time_col`, `value_col`], and optional regressor columns
      Regressor columns should include future values for prediction
  config : :class:`~greykite.framework.templates.model_templates.ForecastConfig` or None
      Config object for template class to use.
      See :class:`~greykite.framework.templates.model_templates.ForecastConfig`.
  
  Returns
  -------
  pipeline_params : `dict` [`str`, `any`]
      Input to :func:`~greykite.framework.pipeline.pipeline.forecast_pipeline`.
docstr_tok: ["Fetches","pipeline","parameters","from","the","``","df","``","and","``","config","``",",","but","does","not","run","the","pipeline","to","generate","a","forecast",".",":","py",":","meth",":","`","~greykite.framework.templates.forecaster.Forecaster.run_forecast_config","`","calls","this","function","and","also","runs","the","forecast","pipeline",".","Available","for","debugging","purposes","to","check","pipeline","parameters","before","running","a","forecast",".","Sets","these","attributes","for","debugging",":","-","``","pipeline_params","``",":","the","parameters","passed","to",":","func",":","`","~greykite.framework.pipeline.pipeline.forecast_pipeline","`",".","-","``","template_class","``",",","``","template","``",":","the","template","class","used","to","generate","the","pipeline","parameters",".","-","``","config","``",":","the",":","class",":","`","~greykite.framework.templates.model_templates.ForecastConfig","`","passed","as","input","to","template","class",",","to","translate","into","pipeline","parameters",".","Provides","basic","validation","on","the","compatibility","of","``","config.model_template","``","with","``","config.model_components_param","``",".","Parameters","--","--","--","--","--","df",":","`","pandas.DataFrame","`","Timeseries","data","to","forecast",".","Contains","columns","[","`","time_col","`",",","`","value_col","`","]",",","and","optional","regressor","columns","Regressor","columns","should","include","future","values","for","prediction","config",":",":","class",":","`","~greykite.framework.templates.model_templates.ForecastConfig","`","or","None","Config","object","for","template","class","to","use",".","See",":","class",":","`","~greykite.framework.templates.model_templates.ForecastConfig","`",".","Returns","--","--","--","-","pipeline_params",":","`","dict","`","[","`","str","`",",","`","any","`","]","Input","to",":","func",":","`","~greykite.framework.pipeline.pipeline.forecast_pipeline","`","."]
code: def apply_forecast_config(
      self, df: pd.DataFrame, config: Optional[ForecastConfig] = None
  ) -> Dict:
      """Fetches pipeline parameters from the ``df`` and ``config``,
      but does not run the pipeline to generate a forecast.
  
      :py:meth:`~greykite.framework.templates.forecaster.Forecaster.run_forecast_config`
      calls this function and also runs the forecast pipeline.
  
      Available for debugging purposes to check pipeline parameters before
      running a forecast. Sets these attributes for debugging:
  
          - ``pipeline_params`` : the parameters passed to
            :func:`~greykite.framework.pipeline.pipeline.forecast_pipeline`.
          - ``template_class``, ``template`` : the template class used to generate the
            pipeline parameters.
          - ``config`` : the :class:`~greykite.framework.templates.model_templates.ForecastConfig`
            passed as input to template class, to translate into pipeline parameters.
  
      Provides basic validation on the compatibility of ``config.model_template``
      with ``config.model_components_param``.
  
      Parameters
      ----------
      df : `pandas.DataFrame`
          Timeseries data to forecast.
          Contains columns [`time_col`, `value_col`], and optional regressor columns
          Regressor columns should include future values for prediction
      config : :class:`~greykite.framework.templates.model_templates.ForecastConfig` or None
          Config object for template class to use.
          See :class:`~greykite.framework.templates.model_templates.ForecastConfig`.
  
      Returns
      -------
      pipeline_params : `dict` [`str`, `any`]
          Input to :func:`~greykite.framework.pipeline.pipeline.forecast_pipeline`.
      """
      self.config = (
          self.__get_config_with_default_model_template_and_components(
              config
          )
      )
      self.config.model_template = self.__get_model_template(
          df=df, config=self.config
      )
      self.template_class = self.__get_template_class(self.config)
      self.template = self.template_class()
      self.pipeline_params = (
          self.template.apply_template_for_pipeline_params(
              df=df, config=self.config
          )
      )
      self.__apply_forecast_one_by_one_to_pipeline_parameters()
      return self.pipeline_params
  
imports: import json
  from copy import deepcopy
  from enum import Enum
  from typing import Dict
  from typing import Optional
  from typing import Type
  import pandas
  from greykite.common.logging import LoggingLevelEnum
  from greykite.common.logging import log_message
  from greykite.common.python_utils import unique_elements_in_list
  from greykite.framework.pipeline.pipeline import ForecastResult
  from greykite.framework.pipeline.pipeline import forecast_pipeline
  from greykite.framework.pipeline.utils import get_basic_pipeline
  from greykite.framework.templates.auto_model_template import get_auto_silverkite_model_template
  from greykite.framework.templates.autogen.forecast_config import ForecastConfig
  from greykite.framework.templates.autogen.forecast_config import forecast_config_from_dict
  from greykite.framework.templates.forecast_config_defaults import ForecastConfigDefaults
  from greykite.framework.templates.model_templates import ModelTemplateEnum
  from greykite.framework.templates.pickle_utils import dump_obj
  from greykite.framework.templates.pickle_utils import load_obj
  from greykite.framework.templates.simple_silverkite_template import SimpleSilverkiteTemplate
  from greykite.framework.templates.template_interface import TemplateInterface
  from greykite.sklearn.estimator.one_by_one_estimator import OneByOneEstimator
label_desc: Use image node_id 6 for calling the Forecaster obj's underlying member method code with example usage: obj.apply_forecast_config(df, config) and returns: self