_ProphetAdapter

class _ProphetAdapter(growth: str = 'linear', changepoints: Optional[List[datetime.datetime]] = None, n_changepoints: int = 25, changepoint_range: float = 0.8, yearly_seasonality: Union[str, bool] = 'auto', weekly_seasonality: Union[str, bool] = 'auto', daily_seasonality: Union[str, bool] = 'auto', holidays: Optional[pandas.core.frame.DataFrame] = None, seasonality_mode: str = 'additive', seasonality_prior_scale: float = 10.0, holidays_prior_scale: float = 10.0, changepoint_prior_scale: float = 0.05, mcmc_samples: int = 0, interval_width: float = 0.8, uncertainty_samples: Union[int, bool] = 1000, stan_backend: Optional[str] = None, additional_seasonality_params: Iterable[Dict[str, Union[str, float, int]]] = ())[source]

Bases: etna.models.base.BaseAdapter

Class for holding Prophet model.

Inherited-members

Parameters
  • growth (str) –

  • changepoints (Optional[List[datetime.datetime]]) –

  • n_changepoints (int) –

  • changepoint_range (float) –

  • yearly_seasonality (Union[str, bool]) –

  • weekly_seasonality (Union[str, bool]) –

  • daily_seasonality (Union[str, bool]) –

  • holidays (Optional[pandas.core.frame.DataFrame]) –

  • seasonality_mode (str) –

  • seasonality_prior_scale (float) –

  • holidays_prior_scale (float) –

  • changepoint_prior_scale (float) –

  • mcmc_samples (int) –

  • interval_width (float) –

  • uncertainty_samples (Union[int, bool]) –

  • stan_backend (Optional[str]) –

  • additional_seasonality_params (Iterable[Dict[str, Union[str, float, int]]]) –

Methods

fit(df, regressors)

Fits a Prophet model.

get_model()

Get internal prophet.Prophet model that is used inside etna class.

predict(df, prediction_interval, quantiles)

Compute predictions from a Prophet model.

predict_components(df)

Estimate prediction components.

Attributes

predefined_regressors_names

fit(df: pandas.core.frame.DataFrame, regressors: List[str]) etna.models.prophet._ProphetAdapter[source]

Fits a Prophet model.

Parameters
  • df (pandas.core.frame.DataFrame) – Features dataframe

  • regressors (List[str]) – List of the columns with regressors

Return type

etna.models.prophet._ProphetAdapter

get_model() prophet.forecaster.Prophet[source]

Get internal prophet.Prophet model that is used inside etna class.

Returns

Internal model

Return type

result

predict(df: pandas.core.frame.DataFrame, prediction_interval: bool, quantiles: Sequence[float]) pandas.core.frame.DataFrame[source]

Compute predictions from a Prophet model.

Parameters
  • df (pandas.core.frame.DataFrame) – Features dataframe

  • prediction_interval (bool) – If True returns prediction interval for forecast

  • quantiles (Sequence[float]) – Levels of prediction distribution

Returns

DataFrame with predictions

Return type

pandas.core.frame.DataFrame

predict_components(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame[source]

Estimate prediction components.

Parameters

df (pandas.core.frame.DataFrame) – features dataframe

Returns

dataframe with prediction components

Return type

pandas.core.frame.DataFrame