class_docstr: Wrapper for Facebook Prophet model.
  
  Parameters
  ----------
  score_func : callable
      see BaseForecastEstimator
  
  coverage : float between [0.0, 1.0]
      see BaseForecastEstimator
  
  null_model_params : dict with arguments to define DummyRegressor null model, optional, default=None
      see BaseForecastEstimator
  
  add_regressor_dict: dictionary of extra regressors to be added to the model, optional, default=None
      These should be available for training and entire prediction interval.
  
      Dictionary format::
  
          add_regressor_dict={  # we can add as many regressors as we want, in the following format
              "reg_col1": {
                  "prior_scale": 10,
                  "standardize": True,
                  "mode": 'additive'
              },
              "reg_col2": {
                  "prior_scale": 20,
                  "standardize": True,
                  "mode": 'multiplicative'
              }
          }
  
  add_seasonality_dict: dict of custom seasonality parameters to be added to the model, optional, default=None
      parameter details: https://github.com/facebook/prophet/blob/main/python/prophet/forecaster.py - refer to
      add_seasonality() function.
      Key is the seasonality component name e.g. 'monthly'; parameters are specified via dict.
  
      Dictionary format::
  
          add_seasonality_dict={
              'monthly': {
                  'period': 30.5,
                  'fourier_order': 5
              },
              'weekly': {
                  'period': 7,
                  'fourier_order': 20,
                  'prior_scale': 0.6,
                  'mode': 'additive',
                  'condition_name': 'condition_col'  # takes a bool column in df with True/False values. This means that
                  # the seasonality will only be applied to dates where the condition_name column is True.
              },
              'yearly': {
                  'period': 365.25,
                  'fourier_order': 10,
                  'prior_scale': 0.2,
                  'mode': 'additive'
              }
          }
  
      Note: If there is a conflict in built-in and custom seasonality e.g. both have "yearly", then custom seasonality
      will be used and Model will throw a warning such as:
      "INFO:prophet:Found custom seasonality named "yearly", disabling built-in yearly seasonality."
  
  kwargs : additional parameters
      Other parameters are the same as Prophet model, with one exception:
      ``interval_width`` is specified by ``coverage``.
  
      See source code ``__init__`` for the parameter names, and refer to
      Prophet documentation for a description:
  
          * https://facebook.github.io/prophet/docs/quick_start.html
          * https://github.com/facebook/prophet/blob/main/python/prophet/forecaster.py
  
  Attributes
  ----------
  model : ``Prophet`` object
      Prophet model object
  forecast : `pandas.DataFrame`
      Output of predict method of ``Prophet``.
class_docstr_tok: ["Wrapper","for","Facebook","Prophet","model",".","Parameters","--","--","--","--","--","score_func",":","callable","see","BaseForecastEstimator","coverage",":","float","between","[","0.0",",","1.0","]","see","BaseForecastEstimator","null_model_params",":","dict","with","arguments","to","define","DummyRegressor","null","model",",","optional",",","default=None","see","BaseForecastEstimator","add_regressor_dict",":","dictionary","of","extra","regressors","to","be","added","to","the","model",",","optional",",","default=None","These","should","be","available","for","training","and","entire","prediction","interval",".","Dictionary","format",":",":","add_regressor_dict=","{","#","we","can","add","as","many","regressors","as","we","want",",","in","the","following","format","``","reg_col1","''",":","{","``","prior_scale","''",":","10",",","``","standardize","''",":","True",",","``","mode","''",":","'additive'","}",",","``","reg_col2","''",":","{","``","prior_scale","''",":","20",",","``","standardize","''",":","True",",","``","mode","''",":","'multiplicative'","}","}","add_seasonality_dict",":","dict","of","custom","seasonality","parameters","to","be","added","to","the","model",",","optional",",","default=None","parameter","details",":","https",":","\/\/github.com\/facebook\/prophet\/blob\/main\/python\/prophet\/forecaster.py","-","refer","to","add_seasonality","(",")","function",".","Key","is","the","seasonality","component","name","e.g",".","'monthly","'",";","parameters","are","specified","via","dict",".","Dictionary","format",":",":","add_seasonality_dict=","{","'monthly","'",":","{","'period","'",":","30.5",",","'fourier_order","'",":","5","}",",","'weekly","'",":","{","'period","'",":","7",",","'fourier_order","'",":","20",",","'prior_scale","'",":","0.6",",","'mode","'",":","'additive","'",",","'condition_name","'",":","'condition_col","'","#","takes","a","bool","column","in","df","with","True\/False","values",".","This","means","that","#","the","seasonality","will","only","be","applied","to","dates","where","the","condition_name","column","is","True",".","}",",","'yearly","'",":","{","'period","'",":","365.25",",","'fourier_order","'",":","10",",","'prior_scale","'",":","0.2",",","'mode","'",":","'additive'","}","}","Note",":","If","there","is","a","conflict","in","built-in","and","custom","seasonality","e.g",".","both","have","``","yearly","''",",","then","custom","seasonality","will","be","used","and","Model","will","throw","a","warning","such","as",":","``","INFO",":","prophet",":","Found","custom","seasonality","named","``","yearly","''",",","disabling","built-in","yearly","seasonality",".","''","kwargs",":","additional","parameters","Other","parameters","are","the","same","as","Prophet","model",",","with","one","exception",":","``","interval_width","``","is","specified","by","``","coverage","``",".","See","source","code","``","__init__","``","for","the","parameter","names",",","and","refer","to","Prophet","documentation","for","a","description",":","*","https",":","\/\/facebook.github.io\/prophet\/docs\/quick_start.html","*","https",":","\/\/github.com\/facebook\/prophet\/blob\/main\/python\/prophet\/forecaster.py","Attributes","--","--","--","--","--","model",":","``","Prophet","``","object","Prophet","model","object","forecast",":","`","pandas.DataFrame","`","Output","of","predict","method","of","``","Prophet","``","."]
docstr: Fits prophet model.
  
  Parameters
  ----------
  X : `pandas.DataFrame`
      Input timeseries, with timestamp column,
      value column, and any additional regressors.
      The value column is the response, included in
      X to allow transformation by `sklearn.pipeline.Pipeline`
  y : ignored
      The original timeseries values, ignored.
      (The y for fitting is included in ``X``.)
  time_col : `str`
      Time column name in ``X``
  value_col : `str`
      Value column name in ``X``
  fit_params : `dict`
      additional parameters for null model
  
  Returns
  -------
  self : self
      Fitted model is stored in ``self.model``.
docstr_tok: ["Fits","prophet","model",".","Parameters","--","--","--","--","--","X",":","`","pandas.DataFrame","`","Input","timeseries",",","with","timestamp","column",",","value","column",",","and","any","additional","regressors",".","The","value","column","is","the","response",",","included","in","X","to","allow","transformation","by","`","sklearn.pipeline.Pipeline","`","y",":","ignored","The","original","timeseries","values",",","ignored",".","(","The","y","for","fitting","is","included","in","``","X","``",".",")","time_col",":","`","str","`","Time","column","name","in","``","X","``","value_col",":","`","str","`","Value","column","name","in","``","X","``","fit_params",":","`","dict","`","additional","parameters","for","null","model","Returns","--","--","--","-","self",":","self","Fitted","model","is","stored","in","``","self.model","``","."]
code: def fit(
      self,
      X,
      y=None,
      time_col=TIME_COL,
      value_col=VALUE_COL,
      **fit_params,
  ):
      """Fits prophet model.
  
      Parameters
      ----------
      X : `pandas.DataFrame`
          Input timeseries, with timestamp column,
          value column, and any additional regressors.
          The value column is the response, included in
          X to allow transformation by `sklearn.pipeline.Pipeline`
      y : ignored
          The original timeseries values, ignored.
          (The y for fitting is included in ``X``.)
      time_col : `str`
          Time column name in ``X``
      value_col : `str`
          Value column name in ``X``
      fit_params : `dict`
          additional parameters for null model
  
      Returns
      -------
      self : self
          Fitted model is stored in ``self.model``.
      """
      super().fit(
          X, y=y, time_col=time_col, value_col=value_col, **fit_params
      )
  
      if self.add_regressor_dict is None:
          fit_columns = [time_col, value_col]
      else:
          reg_cols = list(self.add_regressor_dict.keys())
          fit_columns = [time_col, value_col] + reg_cols
  
      fit_df = X.reset_index(drop=True)[fit_columns]
      fit_df.rename(
          columns={time_col: "ds", value_col: "y"}, inplace=True
      )
      # Prophet expects these column names. Other estimators can use TIME_COL, etc.
      # uses coverage instead of interval_width to set prediction band width. This ensures a common
      # interface for parameters common to every BaseForecastEstimator, usually also needed for forecast evaluation
      # model must be initialized here, not in __init__, to update parameters in grid search
      self.model = prophet.Prophet(
          growth=self.growth,
          changepoints=self.changepoints,
          n_changepoints=self.n_changepoints,
          changepoint_range=self.changepoint_range,
          yearly_seasonality=self.yearly_seasonality,
          weekly_seasonality=self.weekly_seasonality,
          daily_seasonality=self.daily_seasonality,
          holidays=self.holidays,
          seasonality_mode=self.seasonality_mode,
          seasonality_prior_scale=self.seasonality_prior_scale,
          holidays_prior_scale=self.holidays_prior_scale,
          changepoint_prior_scale=self.changepoint_prior_scale,
          mcmc_samples=self.mcmc_samples,
          interval_width=(
              self.coverage or 0.8
          ),  # Prophet can't take None for this param.
          uncertainty_samples=self.uncertainty_samples,
      )
      # if extra regressors are given, we add them to temporal features data
      # This implementation assumes that the regressor(s) are provided in time series df, alongside target column.
      if self.add_regressor_dict is not None:
          for reg_col, reg_params in self.add_regressor_dict.items():
              self.model.add_regressor(name=reg_col, **reg_params)
  
      # if custom seasonality is provided, we supply it to Prophet model
      if self.add_seasonality_dict is not None:
          for (
              seasonality_type,
              seasonality_params,
          ) in self.add_seasonality_dict.items():
              self.model.add_seasonality(
                  name=seasonality_type, **seasonality_params
              )
  
      self.model.fit(fit_df)
      return self
  
file_path: greykite/greykite/sklearn/estimator/prophet_estimator.py
imports: import sys
  from sklearn.exceptions import NotFittedError
  from sklearn.metrics import mean_squared_error
  from greykite.common.constants import PREDICTED_COL
  from greykite.common.constants import PREDICTED_LOWER_COL
  from greykite.common.constants import PREDICTED_UPPER_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.logging import LoggingLevelEnum
  from greykite.common.logging import log_message
  from greykite.common.logging import pprint
  from greykite.sklearn.estimator.base_forecast_estimator import BaseForecastEstimator
label_desc: Use image node_id 2 for calling the ProphetEstimator obj's underlying member method code with example usage: obj.fit(X, y, time_col, value_col) and returns: self