Time Series Forecasting
ASecurityForecast time series (demand, sales, traffic, inventory, sensor readings) and validate forecasts honestly in the project's own stack, such as statsmodels, Prophet, sktime, Darts, StatsForecast or gradient boosting with lag features. Use when choosing a forecast horizon and granularity, building naive and seasonal-naive baselines, designing rolling-origin backtests, creating lag and calendar features without future leakage, handling holidays, promotions and missing periods, producing predictio...
- 19 stars
- 0 votes
- 0 copies
- 3 views
- Added November 29, 2026
Security analysis
100/100Pro scans all 3 files and shows the line behind each finding
npx -y skills add khoavd18/skills --skill time-series-forecasting --agent claude-codeAre you the author of Time Series Forecasting?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/khoavd18-time-series-forecasting)---
name: time-series-forecasting
description: Forecast time series (demand, sales, traffic, inventory, sensor readings) and validate forecasts honestly in the project's own stack, such as statsmodels, Prophet, sktime, Darts, StatsForecast or gradient boosting with lag features. Use when choosing a forecast horizon and granularity, building naive and seasonal-naive baselines, designing rolling-origin backtests, creating lag and calendar features without future leakage, handling holidays, promotions and missing periods, producing prediction intervals, reconciling hierarchical forecasts, or choosing MAE, RMSE, MAPE, sMAPE, WAPE or MASE. Not for cross-sectional models with no forecast horizon (use ml-tabular-modeling) or for testing whether an intervention changed a metric (use statistics-experimentation).
---
# Time-Series Forecasting
Produces forecasts that beat a naive baseline on a backtest built exactly like the real forecasting moment, with honest uncertainty.
## Inputs
- The series (one row per series × period), its granularity and time zone, and any known future inputs (calendar, planned prices or promotions).
- The decision the forecast feeds: horizon, update frequency, level (SKU, store, total) and which error is costlier. Targets and accuracy requirements are `UNKNOWN` until the owner states them.
## Procedure
1. **Detect the stack**: forecasting libraries and versions, existing pipelines, where series and calendars come from. Follow the project's conventions.
2. **Define the forecast contract**: forecast origin (when the forecast is made), horizon (how many periods ahead), granularity, level, and the data available at the origin (reporting lag included).
3. **Profile the series**: length, gaps and missing periods, zeros and intermittency, outliers, level shifts, seasonality, the number of series. Missing periods are made explicit; missing ≠ zero unless the source confirms it.
4. **Baselines first**: naive (last value), seasonal naive (same period last cycle) and a moving average. Every model must beat them on the same backtest.
5. **Rolling-origin backtest**: several forecast origins, each using only data available at that origin, with the real horizon and reporting lag. Design in [backtesting-and-metrics.md](references/backtesting-and-metrics.md).
6. **Features without the future**: lags of at least the horizon, rolling statistics that end at the origin, calendar features, and only exogenous inputs that are known in advance at forecast time. Catalogue in [forecasting-playbook.md](references/forecasting-playbook.md).
7. **Models**: statistical (ETS, ARIMA, Theta), global machine-learning models with lag features, or the project's existing choice. Compare on the backtest, per horizon step.
8. **Metrics**: scale-free and robust ones (MASE, WAPE) next to the business metric; avoid MAPE when actuals can be zero or near zero.
9. **Uncertainty**: prediction intervals and their empirical coverage on the backtest.
10. **Hierarchies**: when totals and parts are both forecast, reconcile them and report which level was optimized.
11. **Report** with evidence labels and hand final comparisons to **ml-model-evaluation** when a formal model decision is needed.
## Rules
- Never shuffle time. Never use a feature whose value would not exist at the forecast origin.
- Report accuracy per horizon step; a one-step-ahead score says nothing about week four.
- Promotions, prices and stockouts change demand: sales during stockouts are censored, not true demand. Flag it instead of modeling it silently.
- Do not fill missing periods with zeros, interpolate or drop outliers without recording the rule and the count.
- Evidence labels and risk tiers come from the [ML quality contract](../ml-model-evaluation/references/ml-quality-contract.md).
## Outputs
A forecast contract, a reproducible pipeline, backtest results per model and per horizon against the baselines, interval coverage, and limitations (censoring, structural breaks, untested conditions).
## Hand-offs
Data extraction and calendar joins → **sql-analytics-expert**. Pandas resampling mechanics → **python-data-analyst**. Did a campaign change sales? → **statistics-experimentation**. Forecast dashboards → **analytics-storytelling**.
Files in this skill
- SKILL.md
- references/backtesting-and-metrics.md
- references/forecasting-playbook.md
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.