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: Convenience function to plot the original trend changepoint detection results.
  
  Parameters
  ----------
  params : `dict` or `None`, default `None`
      The parameters in `~greykite.algo.changepoint.adalasso.changepoint_detector.ChangepointDetector.plot`.
      If set to `None`, all components will be plotted.
  
      Note: seasonality components plotting is not supported currently. ``plot`` parameter must be False.
  
  Returns
  -------
  fig : `plotly.graph_objects.Figure`
      Figure.
code: def plot_trend_changepoint_detection(self, params=None):
      """Convenience function to plot the original trend changepoint detection results.
  
      Parameters
      ----------
      params : `dict` or `None`, default `None`
          The parameters in `~greykite.algo.changepoint.adalasso.changepoint_detector.ChangepointDetector.plot`.
          If set to `None`, all components will be plotted.
  
          Note: seasonality components plotting is not supported currently. ``plot`` parameter must be False.
  
      Returns
      -------
      fig : `plotly.graph_objects.Figure`
          Figure.
      """
      if params is None:
          params = dict(
              observation=True,
              observation_original=True,
              trend_estimate=True,
              trend_change=True,
              yearly_seasonality_estimate=True,
              adaptive_lasso_estimate=True,
              seasonality_change=False,  # currently for trend only
              seasonality_change_by_component=False,
              seasonality_estimate=False,
              plot=False,
          )
      else:
          # currently for trend only
          params["seasonality_change"] = False
          params["seasonality_estimate"] = False
          # need to return the figure object
          params["plot"] = False
      return self.model_dict["changepoint_detector"].plot(**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 11 for calling the BaseSilverkiteEstimator obj's underlying member method code with example usage: obj.plot_trend_changepoint_detection(params) and returns: self