skforecast/skforecast-ai/baseline-forecasting
- community
Checking that the SKILL.md file is still in the repository.
Builds and evaluates simple baseline forecasts with ForecasterEquivalentDate (equivalent-date / seasonal-naive / moving-average) to benchmark machine learning models. Covers offset (int vs pandas DateOffset), n_offsets with agg_func, backtesting a baseline, comparing against ML with MASE, conformal intervals, and grid_search_equivalent_date. Use when the user wants a baseline, a naive or seasonal reference, or to check whether a model beats a simple rule. Not for choosing among ML forecasters (see choosing-a-forecaster) or tuning ML hyperparameters (see hyperparameter-optimization).
Install
npx vskill@latest install skforecast/skforecast-ai/baseline-forecastingSKILL.md
Baseline Forecasting
When to Use
Use this skill to build a simple, explainable baseline with ForecasterEquivalentDate and to check whether a more complex model actually beats it. A baseline predicts each future step from an equivalent past date (e.g. same weekday last week), optionally aggregating several past occurrences.
Always establish a baseline before trusting an ML model: if the ML forecaster cannot beat the naive baseline, the added complexity is not justified.
Related skills
- Prerequisite:
choosing-a-forecaster(decide whether a baseline or an ML model fits the problem) - Alongside:
forecasting-single-series(train the ML model you are benchmarking against) - Next:
metric-selection(use MASE to compare the model against the naive baseline) - Next:
hyperparameter-optimization(route: baselines are tuned withgrid_search_equivalent_date, not the generic search) - Next:
prediction-intervals(add conformal intervals to the baseline)
Stop Conditions
Scan before writing code. Each row lists a rule, the symptom when it is broken, and the recovery.
| Rule | Symptom | Recovery | |
|---|---|---|---|
| Set the index frequency before fitting | ValueError: ... DatetimeIndex with frequency | Call y = y.asfreq('D') (or the correct alias) | |
A pandas DateOffset offset requires a DatetimeIndex with frequency | TypeError: ... the index must be a pandas DatetimeIndex with frequency | Use a DatetimeIndex with asfreq, or use an integer offset for a RangeIndex | |
offset * n_offsets must be smaller than the training window | ValueError: ... offset ... is larger than the available data (or configs silently skipped in search) | Reduce offset/n_offsets, or increase initial_train_size | |
Baselines have no estimator, lags, or exog | Error from grid_search_forecaster (baselines lack set_lags) | Tune with grid_search_equivalent_date; do not pass exog |
Overview
ForecasterEquivalentDate has three modeling parameters:
- `offset` — how far back to look for the equivalent date.
int(number of
steps) or a pandas DateOffset (calendar-aware).
- `n_offsets` — how many equivalent dates to combine (default 1).
- `agg_func` — how to aggregate them when
n_offsets > 1(defaultnp.mean).
offset: int vs pandas DateOffset
This is the part users get wrong most often.
- Integer `offset` — a fixed number of steps back. Works with a
RangeIndex or a DatetimeIndex. offset=7 on daily data = "same day last week"; offset=24 on hourly data = "same hour yesterday".
- pandas `DateOffset` — a calendar rule (e.g.
pd.offsets.Week,
pd.offsets.BusinessDay). Requires a DatetimeIndex with a set frequency. Use it when the equivalent date must follow the calendar (business days, month ends, holidays) rather than a fixed step count.
n_offsets and agg_func
Set n_offsets > 1 to combine several equivalent dates, aggregated by agg_func. offset and n_offsets are coupled (together they define the window), and agg_func decides how the values are pooled:
agg_func is a real, searchable parameter — do not forget it when comparing configurations (e.g. np.mean vs np.median).
Complete Workflow: backtest and compare against a model
See metric-selection for why MASE is the natural yardstick against a naive baseline.
Selecting a configuration
Use grid_search_equivalent_date (baselines are not compatible with the generic grid_search_forecaster). Because offset/n_offsets are coupled and agg_func is a third searchable parameter, prefer the list-of-configs form so every configuration is explicit:
dictform → Cartesian product (use only when every combination is
meaningful).
listform → one explicit configuration per dict (scalar values), avoiding
meaningless offset/n_offsets combinations; each dict may carry an optional alias label that appears as the first results column.
Details and the full parameter table: hyperparameter-optimization (references/search-parameters.md).
Prediction intervals
ForecasterEquivalentDate supports conformal intervals only. Store residuals at fit time, then call predict_interval:
See prediction-intervals for the conformal method details.
Related API
Constructor and method signatures live in the complete-api-reference skill (references/forecaster-constructors.md and references/forecaster-methods.md). This skill covers the baseline workflow and its gotchas, not the full API surface.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskforecast_ai/skills/baseline-forecasting/SKILL.md
Popularity
- Repository stars
- 50
- Repository forks
- 6
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/skforecast/skforecast-ai/baseline-forecasting)