Skip to main content

module statsforecast.adapters.prophet


class AutoARIMAProphet

AutoARIMAProphet adapter. Returns best ARIMA model using external variables created by the Prophet interface. This class receives as parameters the same as prophet.Prophet and uses a models.AutoARIMA backend. If your forecasting pipeline uses Prophet the AutoARIMAProphet adapter helps to easily substitute Prophet with an AutoARIMA. Args:
  • growth (str, default=“linear”): ‘linear’, ‘logistic’ or ‘flat’ to specify a linear, logistic or flat trend.
  • changepoints (List of dates, default=None): Potential changepoints. Otherwise selected automatically.
  • n_changepoints (int, default=25): Number of potential changepoints to include.
  • changepoint_range (float, default=0.8): Proportion of history in which trend changepoints will be estimated.
  • yearly_seasonality (str, bool or int, default=“auto”): Fit yearly seasonality. Can be ‘auto’, True, False, or a number of Fourier terms to generate.
  • weekly_seasonality (str, bool or int, default=“auto”): Fit weekly seasonality. Can be ‘auto’, True, False, or a number of Fourier terms to generate.
  • daily_seasonality (str, bool or int, default=“auto”): Fit daily seasonality. Can be ‘auto’, True, False, or a number of Fourier terms to generate.
  • holidays (pandas.DataFrame, default=None): DataFrame with columns holiday (string) and ds (date type).
  • interval_width (float, default=0.80): Uncertainty forecast intervals width. StatsForecast’s level
Note:
You can create automated exogenous variables from the Prophet data processing pipeline these exogenous will be included into AutoARIMA’s exogenous features. Parameters like seasonality_mode, seasonality_prior_scale, holidays_prior_scale, changepoint_prior_scale, mcmc_samples, uncertainty_samples, stan_backend are Prophet exclusive. References: Sean J. Taylor, Benjamin Letham (2017). “Prophet Forecasting at Scale” Oskar Triebe, Hansika Hewamalage, Polina Pilyugina, Nikolay Laptev, Christoph Bergmeir, Ram Rajagopal (2021). “NeuralProphet: Explainable Forecasting at Scale”. Rob J. Hyndman, Yeasmin Khandakar (2008). “Automatic Time Series Forecasting: The forecast package for R”.

method __init__

__init__(
    growth='linear',
    changepoints=None,
    n_changepoints=25,
    changepoint_range=0.8,
    yearly_seasonality='auto',
    weekly_seasonality='auto',
    daily_seasonality='auto',
    holidays=None,
    seasonality_mode='additive',
    seasonality_prior_scale=10.0,
    holidays_prior_scale=10.0,
    changepoint_prior_scale=0.05,
    mcmc_samples=0,
    interval_width=0.8,
    uncertainty_samples=1000,
    stan_backend=None,
    d=None,
    D=None,
    max_p=5,
    max_q=5,
    max_P=2,
    max_Q=2,
    max_order=5,
    max_d=2,
    max_D=1,
    start_p=2,
    start_q=2,
    start_P=1,
    start_Q=1,
    stationary=False,
    seasonal=True,
    ic='aicc',
    stepwise=True,
    nmodels=94,
    trace=False,
    approximation=False,
    method=None,
    truncate=None,
    test='kpss',
    test_kwargs=None,
    seasonal_test='seas',
    seasonal_test_kwargs=None,
    allowdrift=False,
    allowmean=False,
    blambda=None,
    biasadj=False,
    period=1
)

method fit

fit(df, disable_seasonal_features=True)
Fit the AutoARIMAProphet adapter. Args:
  • df (pandas.DataFrame): DataFrame with columns ds (date type) and y, the time series.
  • disable_seasonal_features (bool, default=True): Disable Prophet’s seasonal features.
Returns:
  • AutoARIMAProphet: Adapter object with AutoARIMA fitted model.

method predict

predict(df=None)
Predict using the AutoARIMAProphet adapter. Args:
  • df (pandas.DataFrame, default=None): DataFrame with columns ds (date type) and y, the time series.
Returns:
  • pandas.DataFrame: DataFrame with the forecast components.