ts-forecasting-stale-lag-methodology

ts-forecasting-stale-lag-methodology is a skill for Claude Code, Codex from topprismdata/cultivating-ml-agent. It costs 133 tokens per session (2,226 once invoked), scanned A, original, MIT.

A methodology for multi-step time-series forecasting when lag features become outdated during the prediction period. It explains how stale recent-history values can cause forecasts to be far too low.

In plain words
What is it for?
Use it when forecasting several future days with lag or rolling features, particularly in retail demand forecasting and Kaggle competitions.
Why use it?
It helps diagnose the gap between strong validation results and much worse competition or test results caused by unrealistic lag values.

Skill for Claude CodeCodex

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

Good fit Use it when forecasting several future days with lag or rolling features, particularly in retail demand forecasting and Kaggle competitions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/topprismdata/cultivating-ml-agent/ts-forecasting-stale-lag-methodology
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 ts-forecasting-stale-lag-methodology
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 ts-forecasting-stale-lag-methodology

README.md
[![agentmods](https://agentmods.dev/badge/skills/topprismdata/cultivating-ml-agent/ts-forecasting-stale-lag-methodology/github.svg)](https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/ts-forecasting-stale-lag-methodology)
Your own site
<a href="https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/ts-forecasting-stale-lag-methodology"><img src="https://agentmods.dev/badge/skills/topprismdata/cultivating-ml-agent/ts-forecasting-stale-lag-methodology/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 ts-forecasting-stale-lag-methodology

Your own site · 80×15
<a href="https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/ts-forecasting-stale-lag-methodology"><img src="https://agentmods.dev/badge/skills/topprismdata/cultivating-ml-agent/ts-forecasting-stale-lag-methodology.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 133 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,226 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.00133 $0.02226
Opus 5 $0.00067 $0.01113
Sonnet 5 $0.00027 $0.00445
Haiku 4.5 $0.00013 $0.00223

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

Security

Grade A, and why

ts-forecasting-stale-lag-methodology 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 7d 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/ts-forecasting-stale-lag-methodology/SKILL.md · 209 lines

How it starts

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

Multi-Step Time Series Forecasting: Stale Lag Methodology

Context

This methodology was developed through the Kaggle Store Sales Time Series Forecasting competition. The journey went from LB 1.859 to LB 0.399 — a 4.7x improvement — through systematic diagnosis and multiple breakthroughs.

The Problem Pattern

In multi-step time series forecasting (predict N days ahead):

  1. You build lag/rolling features (lag_1, rolling_mean_7, etc.)
  2. CV score looks great (0.36)
  3. LB score is 3-10x worse (1.86)
  4. Predictions underpredict by 5-10x (mean=40 vs actual mean=467)

Complete Journey with Failures and Successes

Phase 1: Baseline (LB 1.859)

Approach: LightGBM with lag features, forward-fill for test
Result: CV=0.36, LB=1.859 (5x gap!)
Diagnosis: prediction mean = 40, training mean = 467

Why it fails: All test days get the same ffill'd lag values. The model sees constant recent history and predicts conservatively (low).

Phase 2: Failed Fixes (All Tried, All Failed)

Attempt Result Why It Failed
Tweedie objective LB=1.87 Doesn't fix stale features
Remove short lags LB=2.84 Loses too much signal
Recursive prediction mean=5.87, LB=2.89 Error accumulates through lag features
TE-fill (replace ffill with TE) mean=34 (WORSE!) Model expects noisy lags, smooth TE is OOD
Linear blend model+TE LB=0.83 Better but geometric mean is optimal for RMSLE

Key anti-pattern: Replacing ffill values with TE estimates makes underprediction WORSE. The model learned on noisy real lags — smooth TE estimates are a different kind of OOD.

Phase 3: Geometric Mean Blend Breakthrough (LB 0.670)

Approach: Blend model predictions with TE level using geometric mean in log1p space
Formula: final = expm1(alpha * log1p(model) + (1-alpha) * log1p(te_level))
Best alpha: 0.01 (1% model, 99% TE)
Result: LB = 0.670 (2.8x improvement!)

Why it works:

  • RMSLE is a log-space metric → averaging in log-space is the natural operation
  • Model provides "ranking signal" (which items sell more/less)
  • TE level provides "magnitude signal" (what is the actual sales level)
  • Even 1% model contribution adds meaningful ranking signal

Read the full file on GitHub · 209 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. 7d ago First seen · 209 lines · 133 tokens per session scan A f460b3934861

Subscribe to this mod's changes

ts-forecasting-stale-lag-methodology is a skill published in the GitHub repository topprismdata/cultivating-ml-agent (5 stars, last pushed 13d ago), licensed MIT. It adds 133 tokens to every session and 2,226 once invoked, about $0.0007 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.

Related

Other skills, from other repositories

huggingface-hub

Hugging Face Hub CLI (hf) — search, download, and upload models and datasets, manage repos, query datasets with SQL, deploy inference endpoints, manage Spaces and buckets.

braxtonROSE4/zorro-agent · 43 tokens

tensorboard

Visualize training metrics, debug models with histograms, compare experiments, visualize model graphs, and profile performance with TensorBoard - Google's ML visualization toolkit.

davila7/claude-code-templates · 32 tokens

mlflow

Track ML experiments, manage model registry with versioning, deploy models to production, and reproduce experiments with MLflow - framework-agnostic ML lifecycle platform.

davila7/claude-code-templates · 33 tokens

datachain-knowledge

Use whenever datasets, cloud storage buckets, or data pipelines are mentioned — creating, saving, querying, listing, exploring, deleting, or processing data in S3, GCS, Azure Blob, or local storage. Also use when running any script that may create datasets as a side effect. Maintains a knowledge base at dc-knowledge/…

datachain-ai/datachain · 104 tokens

prompt-scanner

A scanner for text sent to an AI agent, looking for prompt injection and jailbreak attempts. Prompt injection is text that tries to override an agent's instructions; a jailbreak tries to bypass its safety limits.

alibaba/anolisa · 103 tokens

install-openviking-memory

Install and configure the OpenViking long-term memory plugin for OpenClaw via natural conversation. Once installed, the plugin automatically captures facts from chats and recalls relevant context before each reply (auto-capture + auto-recall, cross-session). Covers prerequisites, install through OpenClaw's plugin…

volcengine/OpenViking · 191 tokens