| name | iteration-loop |
| description | Analyze current performance and drive iterative improvement using tree-search. Uses IdeaPool, ErrorAnalysis, and CodeGen to systematically explore the solution space. NEVER submits during iteration โ only generates candidates for review. Trigger: "iterate", "improve", "ไธไธๆญฅ", "next step", "why score bad", "ๅๆฐไธบไปไนไฝ", "ๆไนๆๅ", "error analysis", "่ฏฏๅทฎๅๆ".
|
Iteration Loop Skill
ๅๆๅฝๅ็ถๆ๏ผ้ฉฑๅจ AIDE ้ฃๆ ผ็่ฟญไปฃไผๅ้ญ็ฏใ่ฟญไปฃ้ถๆฎต็ปไธๆไบค โ ๅช็ๆๅ้ๆนๆกใ
Critical Rule: Iteration vs Submission are SEPARATE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ITERATION PHASE (unlimited, free, no cost) โ
โ โ
โ Train โ Evaluate CV โ Compare โ Pick winners โ
โ Repeat 5-20 rounds until convergence โ
โ โ
โ Output: ranked list of candidates + submission files โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ (human decision point)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SUBMISSION PHASE (limited, expensive, max 2/day) โ
โ โ
โ Review candidates โ Pick best 1-2 โ Submit โ
โ Budget-protected, threshold-checked โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Iteration Loop (Agent Decision Layer) โ
โ โ
โ 1. Analyze โ 2. Ideate โ 3. Execute โ 4. Evaluate โ
โ โ โ โ
โ โโโโโโโโโโโโโโ Feedback โโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Convergence reached
โผ
Generate final submission candidates (DO NOT submit)
Workflow
1. ็ถๆๆถ้ & ๅๆ
from kaggle_auto.pipeline import IterationAnalyzer, IdeaPool
workspace = Path("workspaces/<name>")
analyzer = IterationAnalyzer(workspace)
pool = IdeaPool(workspace)
analysis = analyzer.analyze_latest()
comparisons = analyzer.compare_models()
recommendations = analyzer.get_recommendations()
2. Idea Pool Management
pool.seed_from_research(workspace / "reports" / "research_notes.md")
pool.seed_from_analysis(analysis)
next_ideas = pool.get_next(n=3)
pool.mark_tried(idea.id, result="improved", metric_delta=+0.003)
3. Code Generation (AIDE-style)
from kaggle_auto.pipeline import CodeGenerator
codegen = CodeGenerator(workspace)
script = codegen.generate_feature_script(
feature_code='...',
feature_name="ticket_survival",
train_path=str(workspace / "data/raw/train.csv"),
target_col="Survived",
id_col="PassengerId",
)
result = codegen.execute(script)
4. Tree-Search Iteration (CLI)
kar pipeline <name> --iterate 10
kar analyze <name>
kar submit <name> --status
kar submit <name>
5. ็ญ็ฅๆจ่
| Priority | Condition | Action |
|---|
| 1 | cv_stability > 0.1 | Reduce complexity |
| 2 | zero_features > 5 | Feature selection |
| 3 | feature_concentration > 0.8 | Diversify features |
| 4 | stale_rounds >= 3 | Model switch or ensemble |
| 5 | All stable | Generate submission candidate (not submit!) |
6. ๆถๆๅคๆญ & ๅ้่พๅบ
When iteration converges:
- Generate submission files for top 2-3 diverse approaches
- Log their CV scores and method descriptions
- Report to user: "Here are the candidates โ which to submit?"
- WAIT for explicit submit command
Decision Framework for Agent
When the user asks "ไธไธๆญฅ" or "improve":
- Check submission budget โ report remaining submissions
- Run analysis to understand current state
- Iterate locally (5-20 rounds, no submission)
- Present candidates with CV scores ranked
- Wait for user to choose which to submit
NEVER do this:
- Call
submitter.submit() inside an iteration loop
- Set
auto_submit: true during experimentation
- Submit more than the budget allows
Pipeline Integration
The pipeline submit stage should be OFF during development:
submission:
auto_submit: false
max_daily: 2
best_threshold: 0.005
Only enable auto_submit for final production runs with strong confidence.
State Files
.state/
โโโ pipeline_state.json
โโโ iteration_history.json
โโโ journal.json
โโโ idea_pool.json
โโโ submission_budget.json
โโโ scripts/
Auto-Evolution Hook
่ฟญไปฃ็ปๆๅ่ชๅจ่งฆๅ skill-evolution๏ผ
After each iteration batch completes:
1. If new best found โ record what worked to model-train Lesson Log
2. If stale x3 โ record that strategy is exhausted to iteration-loop Lesson Log
3. If CV-LB gap data available โ update calibration in submit-monitor
4. If bug found โ add to NEVER Do in relevant skill
Hard Rules
1. ๆฐธ่ฟไธๅจ่ฟญไปฃไธญๆไบค
ๅณไฝฟ็ปๆ้ๅธธๅฅฝใ็ๆ submission file ๅฏไปฅ๏ผไฝ API call ็ปไธ่งฆๅใ
2. ่ฟ็ปญๆ ๆๅๆถๅๆข็ญ็ฅ
ไธ่ฆๅจๅไธๆนๅๆญป็ฃใFeature โ Hyperparam โ Model switch โ Ensemble๏ผ่บๆๅ่ฟใ
3. ่ฎฐๅฝๆฏๆฌกๅฎ้ช็ๅฎๆดไธไธๆ
ไธๅช่ฎฐๅๆฐ๏ผ่ฟ่ฆ่ฎฐ๏ผ็จไบไปไน็นๅพ้ใไปไนๆจกๅใไปไน่ถ
ๅใๆนไพฟๅๆบฏๆไฝณ็ปๅใ
4. ๅ้่พๅบๅฟ
้กปๆๅคๆ ทๆง
Top 3 candidates ไน้ด็ OOF correlation < 0.95ใๅฆๅๅชไฟ็ๆๅฅฝ็้ฃไธชใ
Lesson Log
| Date | Lesson | Impact |
|---|
| 2026-06-06 | Auto-submit in pipeline burned 10 submissions in minutes | Added strict budget |
| 2026-06-06 | Threshold optimization on OOF doesn't transfer to LB | Don't optimize threshold |
| 2026-06-07 | 5-model stacking not better than 2-model blend on small data | Keep it simple |
| 2026-06-07 | Multi-seed averaging: no LB gain for Titanic | Skip for n<5000 |