_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 internal prophet.Prophet model that is used inside etna class.
predict
(df, prediction_interval, quantiles)Compute predictions from a Prophet model.
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
- 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