time-series-walk-forward-validation

time-series-walk-forward-validation is a skill for Claude Code, Codex from topprismdata/cultivating-ml-agent. It costs 74 tokens per session (1,466 once invoked), scanned A, original, MIT.

A validation method for forecasting and other predictions based on data ordered by time. Walk-forward validation trains on earlier periods and tests on the next period, then moves forward.

In plain words
What is it for?
Use it to evaluate temporal models, set up cross-validation for time series, and check for information leakage.
Why use it?
It prevents future information from entering the training data and producing scores that look good but fail on later real-world data.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to evaluate temporal models, set up cross-validation for time series, and check for information leakage.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/topprismdata/cultivating-ml-agent/time-series-walk-forward-validation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add topprismdata/cultivating-ml-agent --skill time-series-walk-forward-validation
Clone the repo
git clone --depth 1 https://github.com/topprismdata/cultivating-ml-agent

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for time-series-walk-forward-validation

README.md
[![agentmods](https://agentmods.dev/badge/skills/topprismdata/cultivating-ml-agent/time-series-walk-forward-validation/github.svg)](https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/time-series-walk-forward-validation)
Your own site
<a href="https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/time-series-walk-forward-validation"><img src="https://agentmods.dev/badge/skills/topprismdata/cultivating-ml-agent/time-series-walk-forward-validation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for time-series-walk-forward-validation

Your own site · 80×15
<a href="https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/time-series-walk-forward-validation"><img src="https://agentmods.dev/badge/skills/topprismdata/cultivating-ml-agent/time-series-walk-forward-validation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,466 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00074 $0.01466
Opus 5 $0.00037 $0.00733
Sonnet 5 $0.00015 $0.00293
Haiku 4.5 $0.00007 $0.00147

Measured 8d ago against content hash 4039df472d9a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

time-series-walk-forward-validation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/examples/time-series-walk-forward-validation/SKILL.md · 134 lines

How it starts

The opening of the file, as written. The whole thing — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Time Series Walk-Forward Validation

Context

Random K-fold cross-validation on time series data silently destroys validity. A model can score 0.85 on K-fold and 0.65 on live data, wasting weeks of effort. This skill encodes the validation discipline proven in a retail SKU recommendation project (F1 76.5%, walk-forward stable ±0.2pp over 4 weeks).

The core lesson: time goes one direction, and your validation must respect that. Any information from the future — even an "innocent" aggregate like mean purchase frequency — can leak and inflate your CV score.

Guidance

Step 1: Use Walk-Forward, Never K-fold

# ❌ WRONG: K-fold on time series (future leaks into train)
from sklearn.model_selection import KFold
for train_idx, val_idx in KFold(5).split(X):
    model.fit(X[train_idx], y[train_idx])
    score = model.score(X[val_idx], y[val_idx])
    # X[val_idx] is randomly scattered through time!
    # Train contains rows AFTER validation rows.

# ✅ RIGHT: Walk-forward (each fold uses only past data)
train_weeks = [16, 17, 18, 19]
val_weeks = [20]
model.fit(X[train_weeks], y[train_weeks])
score = model.score(X[val_weeks], y[val_weeks])

# Slide forward
train_weeks = [16, 17, 18, 19, 20]
val_weeks = [21]
# ... at least 4 windows for variance estimate

Step 2: Pre-Train Data Leakage 8-Item Checklist

Before ANY model training, verify:

[ ] Training time range strictly < Evaluation time range
[ ] All aggregate features (co-occurrence, statistics, embeddings)
    computed ONLY on train period
[ ] Candidate set generation rule matches what you'll have at prediction time
[ ] N-formula / threshold / quantile inputs contain NO label information
[ ] Eval set customer set ⊆ train-seen customers
    (cold-start customers evaluated separately)
[ ] No "improvement" can be explained as "future information leaked"
[ ] Walk-forward split has ≥4 evaluation windows (for variance estimate)
[ ] Customer/segment populations are stable across windows
    (no massive churn mid-evaluation)

Read the full file on GitHub · 134 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 134 lines · 74 tokens per session scan A 4039df472d9a

Subscribe to this mod's changes

time-series-walk-forward-validation is a skill published in the GitHub repository topprismdata/cultivating-ml-agent (5 stars, last pushed 14d ago), licensed MIT. It adds 74 tokens to every session and 1,466 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.