code: def fit_forecast(df, time_col, value_col):
      """Fits a daily model for this use case.
      The daily model is a generic silverkite model with regressors."""
  
      meta_data_params = MetadataParam(
          time_col=time_col,
          value_col=value_col,
          freq="D",
      )
  
      # Autoregression to be used in the function
      autoregression = {
          "autoreg_dict": {
              "lag_dict": {"orders": [1, 2, 3]},
              "agg_lag_dict": {
                  "orders_list": [[7, 7 * 2, 7 * 3]],
                  "interval_list": [(1, 7), (8, 7 * 2)],
              },
              "series_na_fill_func": lambda s: s.bfill().ffill(),
          },
          "fast_simulation": True,
      }
  
      # Changepoints configuration
      # The config includes changepoints both in trend and seasonality
      changepoints = {
          "changepoints_dict": {
              "method": "auto",
              "yearly_seasonality_order": 15,
              "resample_freq": "2D",
              "actual_changepoint_min_distance": "100D",
              "potential_changepoint_distance": "50D",
              "no_changepoint_distance_from_end": "50D",
          },
          "seasonality_changepoints_dict": {
              "method": "auto",
              "yearly_seasonality_order": 15,
              "resample_freq": "2D",
              "actual_changepoint_min_distance": "100D",
              "potential_changepoint_distance": "50D",
              "no_changepoint_distance_from_end": "50D",
          },
      }
  
      regressor_cols = [
          "regressor_tmin",
          "regressor_bin_pn",
          "regressor_bin_heavy_pn",
      ]
  
      # Model parameters
      model_components = ModelComponentsParam(
          growth=dict(growth_term="linear"),
          seasonality=dict(
              yearly_seasonality=[15],
              quarterly_seasonality=[False],
              monthly_seasonality=[False],
              weekly_seasonality=[7],
              daily_seasonality=[False],
          ),
          custom=dict(
              fit_algorithm_dict=dict(fit_algorithm="ridge"),
              extra_pred_cols=None,
              normalize_method="statistical",
          ),
          regressors=dict(regressor_cols=regressor_cols),
          autoregression=autoregression,
          uncertainty=dict(uncertainty_dict=None),
          events=dict(holiday_lookup_countries=["US"]),
          changepoints=changepoints,
      )
  
      # Evaluation is done on same ``forecast_horizon`` as desired for output
      evaluation_period_param = EvaluationPeriodParam(
          test_horizon=None,
          cv_horizon=forecast_horizon,
          cv_min_train_periods=365 * 2,
          cv_expanding_window=True,
          cv_use_most_recent_splits=False,
          cv_periods_between_splits=None,
          cv_periods_between_train_test=0,
          cv_max_splits=5,
      )
  
      # Runs the forecast model using "SILVERKITE" template
      forecaster = Forecaster()
      result = forecaster.run_forecast_config(
          df=df,
          config=ForecastConfig(
              model_template=ModelTemplateEnum.SILVERKITE.name,
              coverage=0.95,
              forecast_horizon=forecast_horizon,
              metadata_param=meta_data_params,
              evaluation_period_param=evaluation_period_param,
              model_components_param=model_components,
          ),
      )
  
      # Gets cross-validation results
      grid_search = result.grid_search
      cv_results = summarize_grid_search_results(
          grid_search=grid_search, decimals=2, cv_report_metrics=None
      )
      cv_results = cv_results.transpose()
      cv_results = pd.DataFrame(cv_results)
      cv_results.columns = ["err_value"]
      cv_results["err_name"] = cv_results.index
      cv_results = cv_results.reset_index(drop=True)
      cv_results = cv_results[["err_name", "err_value"]]
  
      print(f"\n cv_results: \n {cv_results}")
  
      return result
  
file_path: greykite/docs/nbpages/quickstart/02_interpretability/0200_interpretability.py
imports: import plotly
  import warnings
  import pandas
  from greykite.framework.benchmark.data_loader_ts import DataLoaderTS
  from greykite.framework.templates.autogen.forecast_config import EvaluationPeriodParam
  from greykite.framework.templates.autogen.forecast_config import ForecastConfig
  from greykite.framework.templates.autogen.forecast_config import MetadataParam
  from greykite.framework.templates.autogen.forecast_config import ModelComponentsParam
  from greykite.framework.templates.forecaster import Forecaster
  from greykite.framework.templates.model_templates import ModelTemplateEnum
  from greykite.framework.utils.result_summary import summarize_grid_search_results
  from greykite.common.viz.timeseries_plotting import plot_multivariate
label_desc: Use image node_id 2 for calling a global function with example usage: fit_forecast(df, time_col, value_col) and returns: result