multi-level-aggregation-overfitting
Skill5 starsChanged 34 days agoMITView on GitHub
Use when: (1) considering adding family-level or store-level aggregation features to day-specific models, (2) tempted to copy hierarchical features from 1st place solutions, (3) CV improves but LB degrades after adding aggregated features. WARN: Multi-level aggregation features that work in unified models may OVERFIT in day-specific (direct) forecasting frameworks.
In this repository63 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adversarial-validation-kaggleSkill
- agent-nurture-frameworkSkill
- agent-session-memory-protocolSkill
- arxiv-paper-searchSkill
- autogluon-firstSkill
- autogluon-preset-strategySkill
- autogluon-timeseries-strategySkill
- catboost-first-tabularSkill
- claudeceptionSkill
- code-competition-artifact-pipelineSkill
- competition-orchestration-multimodelSkill
- context-engineeringSkill
- controlled-submission-experimentSkill
- cross-competition-feature-transferSkill
- cv-lb-gap-acknowledgmentSkill
- domain-knowledge-constraints-trapSkill
- ensemble-model-correlation-trapSkill
- feature-engineering-saturation-detectionSkill
- gpu-readiness-assessmentSkill
- gsd-loop-engineeringSkill
- kaggle-cognitive-cost-optimizationSkill
- kaggle-competition-best-practicesSkill
- kaggle-competition-type-strategySkill
- kaggle-data-format-firstSkill
- kaggle-discussion-searchSkill
- kaggle-experiment-sopSkill
- kaggle-oof-lb-validation-protocolSkill
- kaggle-optimal-blendingSkill
- kaggle-submission-format-by-metricSkill
- kaggle-top-performer-replicationSkill
- knowledge-crystallization-feedback-loopSkill
- ladder-drift-and-meta-aware-regressionSkill
- learned-value-beats-heuristic-augmentationSkill
- llm-competition-pipelineSkill
- mcts-pipeline-searchSkill
- mem0-dynamic-graph-memorySkill
- memory-hierarchy-managementSkill
- ml-sweet-spot-principleSkill
- model-ensemble-negative-weight-effectSkill
- multi-agent-rolesSkill
- okf-visualize-knowledgeSkill
- onnx-minimal-network-designSkill
- per-category-modeling-backfireSkill
- progressive-verification-debuggingSkill
- ptcg-2ply-bounded-searchSkill
- ptcg-bc-large-model-submissionSkill
- retail-eda-frameworkSkill
- rmsle-zero-threshold-asymmetrySkill
- runtime-reflexionSkill
- sc-tir-mathematical-reasoningSkill
- self-evolving-skillsSkill
- skill-governance-and-automationSkill
- spatiotemporal-graph-feature-engineeringSkill
- store-sales-darts-chronos-blendSkill
- tabular-polynomial-features-breakthroughSkill
- three-layer-wisdom-extractionSkill
- time-series-walk-forward-validationSkill
- trueskill-simulation-competition-strategySkill
- ts-day-specific-forecastingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 53
Safer alternative: Use target encoding at family/store level instead of raw aggregation
- Distinctive: line 54
Feature budget: Prefer fewer high-signal features (like YoY) over many correlated ones
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Multi-Level Aggregation Overfitting in Day-Specific Models
Problem
1st place solutions often use family-level and store-level aggregation features (family lag, store rolling mean, store-family ratio features). However, when applied to day-specific models (separate model per horizon day), these features can cause overfitting: CV improves but LB degrades.
Why It Overfits
In day-specific models, each model trains on ~2.87M samples covering all (store, family) pairs. The model already sees sufficient examples per pair. Family/store level features add redundancy:
- Leakage via aggregation: Family-level lags are highly correlated with individual
store-family lags (especially for families with few stores). The ratio features
(
sf_to_fam_ratio) may capture noise rather than signal. - Cross-pair interference: Day-specific models learn patterns across all pairs simultaneously. Adding aggregated features increases the feature space without adding truly independent information.
- CV overfitting: The expanding-window CV may not penalize these features enough because the family/store patterns are stable across time, but they don't generalize to the test period's specific dynamics.
Evidence
| Version | Features | CV RMSLE | LB |
| R11b (base) | 82 features | 0.42041 | 0.40073 |
| R12 multilevel | 82 + 18 agg | 0.41668 (better) | 0.39874 (worse vs R11c=0.39824) |
CV improved by 0.00373 but LB got worse by 0.00050 relative to R11c.
In contrast, YoY features (only 4 features) improved LB by 0.00045 with less CV improvement.
Rule of Thumb
- Unified model: Multi-level aggregation likely helps (model needs hints about hierarchy)
- Day-specific model: Multi-level aggregation may overfit (model already sees all pairs)
- Safer alternative: Use target encoding at family/store level instead of raw aggregation
- Feature budget: Prefer fewer high-signal features (like YoY) over many correlated ones
Related
yoy-364day-features— the feature that actually worked insteadcontrolled-submission-experiment— how we isolated this findingts-day-specific-forecasting— the framework where this applies
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

