class_docstr: A derived class of `~greykite.algo.forecast.silverkite.SilverkiteForecast`.
  Provides an alternative interface with simplified configuration parameters.
  Produces the same trained model output and uses the same predict functions.
class_docstr_tok: ["A","derived","class","of","`","~greykite.algo.forecast.silverkite.SilverkiteForecast","`",".","Provides","an","alternative","interface","with","simplified","configuration","parameters",".","Produces","the","same","trained","model","output","and","uses","the","same","predict","functions","."]
docstr: Defines features sets for use in the `extra_pred_cols` parameter
  to `forecast_silverkite`.
  Derived from events, seasonality, and trend (growth + changepoints).
  
  :param daily_event_df_dict: Optional[Dict[str, pd.DataFrame("date", "event")]]
      suitable for use as `daily_event_df_dict` parameter in `forecast_silverkite`
      Each event is modeled as its own effect
  :param daily_seas_interaction_order: int
      Order on interaction terms with daily seasonality
  :param weekly_seas_interaction_order: int
      Order on interaction terms with weekly seasonality
  :param growth_term: Optional[str]
      How to model the growth. Valid options are "linear", "quadratic", "sqrt", "cubic", "cuberoot".
      See `~greykite.common.constants.GrowthColEnum`.
  :param changepoint_cols: Optional[List[str]]
      Names of the changepoint feature columns to be generated by `build_silverkite_features`
  :return: Dict[str, List[str]]
      The patsy model terms for each feature set
      key: feature set name
      value: list of patsy model terms
          If there are no valid patsy model terms according to the input configuration,
          the list is empty.
          For example, if there are no events, the event related effects will be empty
code: def __get_feature_sets_terms(
      self,
      daily_event_df_dict=None,
      daily_seas_interaction_order=0,
      weekly_seas_interaction_order=0,
      growth_term=None,
      changepoint_cols=None,
  ):
      """Defines features sets for use in the `extra_pred_cols` parameter
      to `forecast_silverkite`.
      Derived from events, seasonality, and trend (growth + changepoints).
  
      :param daily_event_df_dict: Optional[Dict[str, pd.DataFrame("date", "event")]]
          suitable for use as `daily_event_df_dict` parameter in `forecast_silverkite`
          Each event is modeled as its own effect
      :param daily_seas_interaction_order: int
          Order on interaction terms with daily seasonality
      :param weekly_seas_interaction_order: int
          Order on interaction terms with weekly seasonality
      :param growth_term: Optional[str]
          How to model the growth. Valid options are "linear", "quadratic", "sqrt", "cubic", "cuberoot".
          See `~greykite.common.constants.GrowthColEnum`.
      :param changepoint_cols: Optional[List[str]]
          Names of the changepoint feature columns to be generated by `build_silverkite_features`
      :return: Dict[str, List[str]]
          The patsy model terms for each feature set
          key: feature set name
          value: list of patsy model terms
              If there are no valid patsy model terms according to the input configuration,
              the list is empty.
              For example, if there are no events, the event related effects will be empty
      """
      # enumerates all possible keys
      extra_pred_cols_grouped = {
          self._silverkite_column.COLS_HOUR_OF_WEEK: [],
          self._silverkite_column.COLS_WEEKEND_SEAS: [],
          self._silverkite_column.COLS_DAY_OF_WEEK_SEAS: [],
          self._silverkite_column.COLS_TREND_DAILY_SEAS: [],
          self._silverkite_column.COLS_EVENT_SEAS: [],
          self._silverkite_column.COLS_EVENT_WEEKEND_SEAS: [],
          self._silverkite_column.COLS_DAY_OF_WEEK: [],
          self._silverkite_column.COLS_TREND_WEEKEND: [],
          self._silverkite_column.COLS_TREND_DAY_OF_WEEK: [],
          self._silverkite_column.COLS_TREND_WEEKLY_SEAS: [],
      }
  
      # the columns which constitute the trend
      if changepoint_cols is None:
          changepoint_cols = []
      growth_col = [growth_term] if growth_term is not None else []
      trend_cols = growth_col + changepoint_cols
  
      # all possible values of `dow` and `dow_hr` from `build_time_features_df`
      dow_levels = [
          "1-Mon",
          "2-Tue",
          "3-Wed",
          "4-Thu",
          "5-Fri",
          "6-Sat",
          "7-Sun",
      ]
      dow_hr_levels = [
          f"{day + 1}_{str(hour).zfill(2)}"
          for day in range(7)
          for hour in range(24)
      ]
      day_of_week = patsy_categorical_term(
          term=cst.TimeFeaturesEnum.str_dow.value, levels=dow_levels
      )
      hour_of_week = patsy_categorical_term(
          term=cst.TimeFeaturesEnum.dow_hr.value, levels=dow_hr_levels
      )
  
      extra_pred_cols_grouped[
          self._silverkite_column.COLS_DAY_OF_WEEK
      ] = [day_of_week]
      extra_pred_cols_grouped[
          self._silverkite_column.COLS_HOUR_OF_WEEK
      ] = [hour_of_week]
      extra_pred_cols_grouped[
          self._silverkite_column.COLS_TREND_WEEKEND
      ] = [
          f"{cst.TimeFeaturesEnum.is_weekend.value}:{col}"
          for col in trend_cols
      ]
      extra_pred_cols_grouped[
          self._silverkite_column.COLS_TREND_DAY_OF_WEEK
      ] = [f"{day_of_week}:{col}" for col in trend_cols]
  
      # allows major holidays to have different daily seasonality
      # interact with fourier series terms up to fs_daily_interaction_order
      daily_seasonality = (
          self._silverkite_seasonality_enum.DAILY_SEASONALITY.value
      )
      weekly_seasonality = (
          self._silverkite_seasonality_enum.WEEKLY_SEASONALITY.value
      )
      if daily_seas_interaction_order > 0:
          for holiday in self._silverkite_holiday.HOLIDAYS_TO_INTERACT:
              if (
                  daily_event_df_dict is not None
                  and holiday in daily_event_df_dict.keys()
              ):
                  event_levels = [
                      cst.EVENT_DEFAULT
                  ]  # reference level for non-event days, added by `add_daily_events`
                  # This event's levels
                  event_levels += list(
                      daily_event_df_dict[holiday][
                          cst.EVENT_DF_LABEL_COL
                      ].unique()
                  )
  
                  # `term` matches new_col in `add_daily_events`
                  term = f"{cst.EVENT_PREFIX}_{holiday}"
                  extra_pred_cols_grouped[
                      self._silverkite_column.COLS_EVENT_SEAS
                  ] += cols_interact(
                      static_col=f"{patsy_categorical_term(term=term, levels=event_levels)}",
                      fs_name=daily_seasonality.name,
                      fs_order=daily_seas_interaction_order,
                      fs_seas_name=daily_seasonality.seas_names,
                  )
  
                  extra_pred_cols_grouped[
                      self._silverkite_column.COLS_EVENT_WEEKEND_SEAS
                  ] += cols_interact(
                      static_col=f"{cst.TimeFeaturesEnum.is_weekend.value}:"
                      f"{patsy_categorical_term(term=term, levels=event_levels)}",
                      fs_name=daily_seasonality.name,
                      fs_order=daily_seas_interaction_order,
                      fs_seas_name=daily_seasonality.seas_names,
                  )
  
          extra_pred_cols_grouped[
              self._silverkite_column.COLS_WEEKEND_SEAS
          ] = cols_interact(
              static_col=cst.TimeFeaturesEnum.is_weekend.value,
              fs_name=daily_seasonality.name,
              fs_order=daily_seas_interaction_order,
              fs_seas_name=daily_seasonality.seas_names,
          )
  
          extra_pred_cols_grouped[
              self._silverkite_column.COLS_DAY_OF_WEEK_SEAS
          ] = cols_interact(
              static_col=day_of_week,
              fs_name=daily_seasonality.name,
              fs_order=daily_seas_interaction_order,
              fs_seas_name=daily_seasonality.seas_names,
          )
  
          for col in trend_cols:
              extra_pred_cols_grouped[
                  self._silverkite_column.COLS_TREND_DAILY_SEAS
              ] += cols_interact(
                  static_col=f"{cst.TimeFeaturesEnum.is_weekend.value}:{col}",
                  fs_name=daily_seasonality.name,
                  fs_order=daily_seas_interaction_order,
                  fs_seas_name=daily_seasonality.seas_names,
              )
  
      if weekly_seas_interaction_order > 0:
          for col in trend_cols:
              extra_pred_cols_grouped[
                  self._silverkite_column.COLS_TREND_WEEKLY_SEAS
              ] += cols_interact(
                  static_col=col,
                  fs_name=weekly_seasonality.name,
                  fs_order=weekly_seas_interaction_order,
                  fs_seas_name=weekly_seasonality.seas_names,
              )
  
      return extra_pred_cols_grouped
  
imports: from datetime import datetime
  from typing import Dict
  from typing import List
  from typing import Optional
  from typing import Type
  from typing import Union
  import pandas
  from greykite.algo.changepoint.adalasso.changepoint_detector import get_changepoints_dict
  from greykite.algo.forecast.silverkite.auto_config import get_auto_growth
  from greykite.algo.forecast.silverkite.auto_config import get_auto_holidays
  from greykite.algo.forecast.silverkite.auto_config import get_auto_seasonality
  from greykite.algo.forecast.silverkite.constants.silverkite_column import SilverkiteColumn
  from greykite.algo.forecast.silverkite.constants.silverkite_constant import SilverkiteConstant
  from greykite.algo.forecast.silverkite.constants.silverkite_constant import default_silverkite_constant
  from greykite.algo.forecast.silverkite.constants.silverkite_holiday import SilverkiteHoliday
  from greykite.algo.forecast.silverkite.constants.silverkite_time_frequency import SilverkiteTimeFrequencyEnum
  from greykite.algo.forecast.silverkite.forecast_silverkite import SilverkiteForecast
  from greykite.algo.forecast.silverkite.forecast_simple_silverkite_helper import cols_interact
  from greykite.algo.forecast.silverkite.forecast_simple_silverkite_helper import generate_holiday_events
  from greykite.algo.forecast.silverkite.forecast_simple_silverkite_helper import get_event_pred_cols
  from greykite.algo.forecast.silverkite.forecast_simple_silverkite_helper import patsy_categorical_term
  from greykite.common import constants
  from greykite.common.constants import GrowthColEnum
  from greykite.common.enums import SimpleTimeFrequencyEnum
  from greykite.common.enums import TimeEnum
  from greykite.common.features.timeseries_features import get_available_holidays_across_countries
  from greykite.common.features.timeseries_features import get_changepoint_features_and_values_from_config
  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.common.python_utils import update_dictionary
  from greykite.common.time_properties_forecast import get_forecast_time_properties
label_desc: Use image node_id 8 for calling the SimpleSilverkiteForecast obj's underlying member method code with example usage: obj.__get_feature_sets_terms(daily_event_df_dict, daily_seas_interaction_order, weekly_seas_interaction_order, growth_term, changepoint_cols) and returns: extra_pred_cols_grouped