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.
npx skills add topprismdata/cultivating-ml-agent --skill per-category-modeling-backfiregit clone --depth 1 https://github.com/topprismdata/cultivating-ml-agentWrote 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.
[](https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/per-category-modeling-backfire)<a href="https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/per-category-modeling-backfire"><img src="https://agentmods.dev/badge/skills/topprismdata/cultivating-ml-agent/per-category-modeling-backfire/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.
<a href="https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/per-category-modeling-backfire"><img src="https://agentmods.dev/badge/skills/topprismdata/cultivating-ml-agent/per-category-modeling-backfire.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00103 | $0.01560 |
| Opus 5.5 | $0.00041 | $0.00624 |
| Sonnet 5.5 | $0.00021 | $0.00312 |
| Haiku 4.5 | $0.00010 | $0.00156 |
Grade A, and why
per-category-modeling-backfire 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 3mo 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.
How it starts
The opening of the file, as written. The whole thing — 156 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Per-Category Modeling Backfire: When Splitting Data Hurts
Problem
A common "advanced" technique in Kaggle competitions is to train separate models for each category (e.g., per product family, per store, per region). While this seems intuitively correct—different categories have different patterns—it can backfire spectacularly when individual categories lack sufficient data volume.
Context / Trigger Conditions
Use when considering:
- Training separate GBDT models per product family, store, or region
- Per-category CV improves but leaderboard score degrades
- Each category has <100K rows but the full dataset has >1M rows
- Categories have highly imbalanced data volumes (some huge, some tiny)
- The global model already handles category differences via categorical features
Specific symptoms:
- Per-category CV: 0.367 (better) vs Global CV: 0.375 → Per-category LB: 2.10 vs Global LB: 1.86
- Small categories show high CV variance (>0.05 std across folds)
- Test predictions from per-category models have shifted mean (higher or lower than expected)
Solution
The Data Volume Threshold
Per-category modeling only works when each category has enough data to train a robust model.
| Rows per category | Per-category modeling | Recommendation |
|---|---|---|
| <50K | Harmful — overfitting, high variance | Use global model |
| 50K-200K | Risky — depends on problem complexity | Test both, compare LB |
| 200K-1M | Usually beneficial | Per-category if CV confirms |
| >1M | Almost always beneficial | Per-category recommended |
Why It Fails With Small Categories
- Overfitting: 70K rows × 5-fold CV = 14K validation rows. Easy to overfit.
- High variance: Small categories (BOOKS, HARDWARE) have CV std >0.05, meaning the model is unstable across folds.
- Feature instability: Lag/rolling features with limited history don't generalize.
- Loss of cross-category signal: Global model learns that "weekend → more sales" applies across ALL categories, amplifying this signal. Per-category models each must re-learn this from limited data.
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.
- 3mo ago First seen · 156 lines · 103 tokens per session scan A 6a46ee7cdd6e
per-category-modeling-backfire is a skill published in the GitHub repository topprismdata/cultivating-ml-agent (5 stars, last pushed 1mo ago), licensed MIT. It adds 103 tokens to every session and 1,560 once invoked, about $0.0004 per session on Opus 5.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-08-31.
per-category-modeling-backfire compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| per-category-modeling-backfiretopprismdata/cultivating-ml-agent | Skill | 5 | 1mo ago | MIT | A | 103 | Claude Code, Codex |
| huggingface-hubbraxtonROSE4/zorro-agent | Skill | 11 | 7mo ago | MIT | C | 43 | Claude Code, Codex |
| agent-v3-memory-specialistruvnet/ruflo | Skill | 83k | today | MIT | A | 25 | Claude Code |
| agent-safla-neuralruvnet/ruflo | Skill | 83k | today | MIT | A | 24 | Claude Code |
| neural-trainingruvnet/ruflo | Skill | 83k | today | MIT | A | 64 | Claude Code |
| kv-cache-designbojieli/ai-agent-book | Skill | 60k | yesterday | Apache-2.0 | A | 91 | Claude Code, Codex |
| reward-designbojieli/ai-agent-book | Skill | 60k | yesterday | Apache-2.0 | A | 131 | Claude Code, Codex |