| name | forecasting-models |
| description | Build time-series forecasting models for business metrics. Outputs model selection framework, Prophet/ARIMA implementation, evaluation methodology, production serving pattern, and uncertainty quantification. |
| argument-hint | ["metric to forecast","data frequency","horizon","seasonality patterns","accuracy requirements"] |
| allowed-tools | Read, Write, Bash |
Forecasting Models
Forecasting predicts future values of a time series: revenue, demand, traffic, capacity. Good forecasting requires understanding trend, seasonality, holidays, and exogenous variables. The best model is often not the most complex — a well-tuned baseline beats a poorly-tuned neural network.
Model Selection Guide
< 2 years data, clear seasonality, need interpretability
→ Prophet (Meta) — excellent defaults; handles missing data; holidays
Stationary data, no clear seasonality
→ ARIMA / SARIMA — classical; well-understood; interpretable
Multiple related series (1000 products)
→ LightGBM/XGBoost with lag features — scales; captures cross-series
Long sequences, complex patterns, large data
→ Temporal Fusion Transformer — highest accuracy; needs much more data
ALWAYS BEAT THESE BASELINES FIRST:
Naive: forecast = last observed value
Seasonal naive: forecast = same period last year
Moving average: forecast = mean of last N periods
Prophet Implementation
from prophet import Prophet
from prophet.diagnostics cross_validation, performance_metrics
pandas pd
numpy np
() -> :
model = Prophet(
growth=,
seasonality_mode=,
yearly_seasonality=,
weekly_seasonality=,
daily_seasonality=,
changepoint_prior_scale=,
interval_width=,
)
model.add_seasonality(name=, period=, fourier_order=)
model.add_country_holidays(country_name=)
model.add_regressor()
model.add_regressor()
model.fit(df)
future = model.make_future_dataframe(periods=)
future[] = df[].mean()
future[] =
forecast = model.predict(future)
cv_results = cross_validation(
model,
initial=,
period=,
horizon=,
parallel=,
)
metrics = performance_metrics(cv_results)
{
: model,
: forecast[[, , , ]],
: metrics[].mean(),
: metrics[].mean(),
}