class_docstr: A base class for forecast estimators that fit using
  `~greykite.algo.forecast.silverkite.forecast_silverkite.SilverkiteForecast.forecast`.
  
  Notes
  -----
  Allows estimators that fit using
  `~greykite.algo.forecast.silverkite.forecast_silverkite.SilverkiteForecast.forecast`
  to share the same functions for input data validation,
  fit postprocessing, predict, summary, plot_components, etc.
  
  Subclasses should:
  
      - Implement their own ``__init__`` that uses a superset of the parameters here.
      - Implement their own ``fit``, with this sequence of steps:
  
          - calls ``super().fit``
          - calls ``SilverkiteForecast.forecast`` or ``SimpleSilverkiteForecast.forecast_simple`` and stores the result in ``self.model_dict``
          - calls ``super().finish_fit``
  
  Uses ``coverage`` to set prediction band width. Even though
  coverage is not needed by ``forecast_silverkite``, it is included
  in every ``BaseForecastEstimator`` to be used universally for
  forecast evaluation.
  
  Therefore, ``uncertainty_dict`` must be consistent with ``coverage``
  if provided as a dictionary. If ``uncertainty_dict`` is None or
  "auto", an appropriate default value is set, according to ``coverage``.
  
  Parameters
  ----------
  score_func : callable, optional, default mean_squared_error
      See `~greykite.sklearn.estimator.base_forecast_estimator.BaseForecastEstimator`.
  coverage : `float` between [0.0, 1.0] or None, optional
      See `~greykite.sklearn.estimator.base_forecast_estimator.BaseForecastEstimator`.
  null_model_params : `dict`, optional
      Dictionary with arguments to define DummyRegressor null model, default is `None`.
      See `~greykite.sklearn.estimator.base_forecast_estimator.BaseForecastEstimator`.
  uncertainty_dict : `dict` or `str` or None, optional
      How to fit the uncertainty model.
      See `~greykite.algo.forecast.silverkite.forecast_silverkite.SilverkiteForecast.forecast`.
      Note that this is allowed to be "auto". If None or "auto", will be set to
      a default value by ``coverage`` before calling ``forecast_silverkite``.
  
  Attributes
  ----------
  silverkite : Class or a derived class of `~greykite.algo.forecast.silverkite.forecast_silverkite.SilverkiteForecast`
      The silverkite algorithm instance used for forecasting
  model_dict : `dict` or None
      A dict with fitted model and its attributes.
      The output of `~greykite.algo.forecast.silverkite.forecast_silverkite.SilverkiteForecast.forecast`.
  pred_cols : `list` [`str`] or None
      Names of the features used in the model.
  feature_cols : `list` [`str`] or None
      Column names of the patsy design matrix built by
      `~greykite.algo.common.ml_models.design_mat_from_formula`.
  df : `pandas.DataFrame` or None
      The training data used to fit the model.
  coef_ : `pandas.DataFrame` or None
      Estimated coefficient matrix for the model.
      Not available for ``random forest`` and ``gradient boosting`` methods and
      set to the default value `None`.
  _pred_category : `dict` or None
      A dictionary with keys being the predictor category and
      values being the predictors belonging to the category.
      For details, see
      `~greykite.sklearn.estimator.base_silverkite_estimator.BaseSilverkiteEstimator.pred_category`.
  extra_pred_cols : `list` or None
      User provided extra predictor names, for details, see
      `~greykite.sklearn.estimator.simple_silverkite_estimator.SimpleSilverkiteEstimator`
      or
      `~greykite.sklearn.estimator.silverkite_estimator.SilverkiteEstimator`.
  past_df : `pandas.DataFrame` or None
      The extra past data before training data used to generate autoregression terms.
  forecast : `pandas.DataFrame` or None
      Output of ``predict_silverkite``, set by ``self.predict``.
  forecast_x_mat : `pandas.DataFrame` or None
      The design matrix of the model at the predict time.
  model_summary : `class` or `None`
      The `~greykite.algo.common.model_summary.ModelSummary` class.
  
  See Also
  --------
  `~greykite.algo.forecast.silverkite.forecast_silverkite.SilverkiteForecast.forecast`
      Function performing the fit and predict.
  
  Notes
  -----
  The subclasses will pass ``fs_components_df`` to ``forecast_silverkite``. The model terms
  it creates internally are used to generate the component plots.
  
      - `~greykite.common.features.timeseries_features.fourier_series_multi_fcn` uses
        ``fs_components_df["names"]`` (e.g. ``tod``, ``tow``) to build the fourier series
        and to create column names.
  
      - ``fs_components_df["seas_names"]`` (e.g. ``daily``, ``weekly``) is appended
        to the column names, if provided.
  
  `~greykite.sklearn.estimator.base_silverkite_estimator.BaseSilverkiteEstimator.plot_components` relies
  on a regular expression dictionary to group components together.  There are two available in the library, see
  `~greykite.common.constants` for the two definitions
  
      1. "DEFAULT_COMPONENTS_REGEX_DICT"
         Grouped seasonality that is the default
      2. "DETAILED_SEASONALITY_COMPONENTS_REGEX_DICT":
         A detailed seasonality breakdown where the user can view daily/weekly/monthly/quarterly/yearly seasonality
docstr: Pre-processing before fitting ``Silverkite`` forecast 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`.
  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.
  
  Notes
  -----
  Subclasses are expected to call this at the beginning of their ``fit`` method,
  before calling `~greykite.algo.forecast.silverkite.forecast_silverkite.SilverkiteForecast.forecast`.
code: def fit(
      self,
      X,
      y=None,
      time_col=cst.TIME_COL,
      value_col=cst.VALUE_COL,
      **fit_params,
  ):
      """Pre-processing before fitting ``Silverkite`` forecast 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`.
      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.
  
      Notes
      -----
      Subclasses are expected to call this at the beginning of their ``fit`` method,
      before calling `~greykite.algo.forecast.silverkite.forecast_silverkite.SilverkiteForecast.forecast`.
      """
      # NB: calls `__set_uncertainty_dict` before `super().fit` to ensure
      # coverage is correct before fitting the null model.
      # (null model does not currently use `coverage`, but may in the future.)
      self.__set_uncertainty_dict(
          X=X, time_col=time_col, value_col=value_col
      )
      self.df = X
  
      super().fit(
          X=X, y=y, time_col=time_col, value_col=value_col, **fit_params
      )
  
imports: import re
  from typing import Dict
  from typing import Optional
  from typing import Type
  import pandas
  import plotly.express
  from pandas.tseries.frequencies import to_offset
  from plotly import graph_objects
  from plotly.subplots import make_subplots
  from sklearn.exceptions import NotFittedError
  from sklearn.metrics import mean_squared_error
  from greykite.algo.changepoint.adalasso.changepoints_utils import get_trend_changepoint_dates_from_cols
  from greykite.algo.common.col_name_utils import create_pred_category
  from greykite.algo.common.ml_models import breakdown_regression_based_prediction
  from greykite.algo.common.model_summary import ModelSummary
  from greykite.algo.forecast.silverkite.constants.silverkite_component import SilverkiteComponentsEnum
  from greykite.algo.forecast.silverkite.constants.silverkite_constant import default_silverkite_constant
  from greykite.algo.forecast.silverkite.forecast_silverkite import SilverkiteForecast
  from greykite.algo.forecast.silverkite.forecast_silverkite_helper import get_silverkite_uncertainty_dict
  from greykite.common import constants
  from greykite.common.features.timeseries_lags import min_max_lag_order
  from greykite.common.time_properties import min_gap_in_seconds
  from greykite.common.time_properties_forecast import get_simple_time_frequency_from_period
  from greykite.sklearn.estimator.base_forecast_estimator import BaseForecastEstimator
  from greykite.sklearn.uncertainty.uncertainty_methods import UncertaintyMethodEnum
label_desc: Use image node_id 3 for calling the BaseSilverkiteEstimator obj's underlying member method code with example usage: obj.fit(X, y, time_col, value_col) without return types