Automatisation des compétitions Kaggle

VérifiéSûr

Workflow complet pour les compétitions Kaggle, de la validation à la soumission, optimisé pour Codex. Inclut l'analyse des règles, la modélisation, l'architecture de notebooks multiples et l'optimisation des scores.

Spar Skills Guide Bot
Data & IAAvancé
25/07/2026
CodexClaude Code
#kaggle#machine-learning#model-ensembling#notebooks#validation

Recommandé pour

Synthèse automatique

Un flux de travail agentique de bout en bout pour mener des compétitions Kaggle, du baseline à la soumission notée, incluant la conception de la validation, l'entraînement de modèles, l'ensembling et les pipelines multi-notebooks.

Points forts

  • Impose une boucle centrée sur la validation, avec des colonnes de folds cohérentes et des prédictions OOF pour éviter les fuites.
  • Décrit une architecture producteur/consommateur de notebooks qui exporte les artefacts de modèles en datasets Kaggle privés.
  • Couvre le débogage des soumissions et la récupération des scores pour les compétitions de code.
  • Assure le suivi des runs, seeds, versions de données et chemins d'artefacts à chaque itération.

Limites

  • Spécifique à Kaggle : pertinent uniquement pour les compétitions de ML.
  • Dépend d'outils Kaggle externes et d'outils d'intelligence compétitive qui peuvent ne pas être disponibles.
  • Ne détaille pas de techniques de modélisation précises et suppose une solide expertise en ML.
Quand l'utiliser

À utiliser pour démarrer ou itérer sur une compétition Kaggle nécessitant des soumissions notées et une validation robuste.

Quand l'éviter

Inadapté aux tâches générales de développement logiciel ou au travail ML hors du contexte d'une compétition Kaggle.

Analyse de sécurité

Sûr
Score qualité88/100

The skill provides a high-level workflow for Kaggle competitions, including data access, notebook execution, submission, and score retrieval. It does not contain destructive commands, exfiltration instructions, obfuscated payloads, or safety bypasses. All actions are legitimate for competitive ML work, though it assumes the agent has Kaggle credentials and API access, which is normal for this domain.

Aucun point d'attention détecté

Comment cette analyse est faite

Exemples

Build a metric-correct baseline
Start this Kaggle competition for me: read the rules, data dictionary, and metric, classify the submission mode, then build the simplest metric-correct baseline with a consistent fold column, OOF predictions, and a valid submission.
Producer/consumer pipeline
Design a multi-notebook Kaggle pipeline for this image competition: create producer notebooks that train diverse models and export checkpoints as private datasets, then one consumer notebook that attaches them and produces the final OOF, test predictions, and submission.
Debug a failed code submission
My code competition submission failed with a vague scoring error. Retrieve the logs, diagnose the likely failure mode, patch the kernel defensively, rerun it on Kaggle, and resubmit until it scores.

name: agentic-kaggle-skill description: Kaggle-first end-to-end competition workflow for scored submissions. Use when Codex must run Kaggle or competitive ML workflows through scored submission, including code competitions, validation, metrics, policy-safe public notebook/discussion intel, tabular/text/image modeling, tuning, ensembling/stacking, proactive multi-notebook architectures, producer notebooks that train models and export private Kaggle artifact datasets, downstream consumer notebooks, Kaggle GPU offload, kagglehub access, hidden-test debugging, and public score retrieval.

Agentic Kaggle Skill

Operating Loop

Treat every competition as a validation problem first and a modeling problem second. The default target platform is Kaggle, so prefer Kaggle-native notebooks/scripts, datasets, model artifacts, competition submissions, and score receipts. For code competitions, assume the final notebook/kernel will be rerun by Kaggle against hidden data unless the competition docs prove otherwise.

  1. Read the competition page, classify the submission mode as classic file submission or code/notebook scoring, then inspect the rules, data-use terms, sharing policy, data dictionary, metric, submission format, train/test construction hints, and leakage warnings.
  2. If live competition intelligence tools are available, inspect top public open notebook solutions and relevant discussion activity before major architecture choices; treat them as clues, not authority.
  3. Identify the task type: binary, multiclass, multilabel, regression, ranking, image, segmentation, text, time series, grouped entities, or a hybrid.
  4. Design folds before feature engineering or modeling. Prefer a fold column saved into the training data so every experiment uses the same comparison surface.
  5. Build the simplest metric-correct baseline and produce out-of-fold (OOF) predictions plus a valid submission.
  6. Proactively plan a stronger architecture once the baseline is trustworthy: diverse model families, feature/embedding producers, augmentation/pseudo-label/distillation stages, calibration/postprocessing, and an ensemble or stacker.
  7. Iterate with validation gates: test one meaningful change at a time when possible, but launch several independent producer notebooks in parallel when they create diverse artifacts that can be compared by OOF score or ensemble diversity.
  8. Offload heavy training, inference, embedding generation, image/text experiments, or memory-risky jobs to Kaggle notebooks/scripts when local compute may OOM or take too long.
  9. For sophisticated architectures, split work into a small Kaggle pipeline: run several independent producer notebooks/scripts first, save each useful producer output as a private Kaggle dataset, then run one consumer notebook/script that attaches those datasets and creates the final OOF/test/submission outputs. When a producer trains a model, its checkpoint, tokenizer/config, fold metadata, OOF/test predictions, and manifest should be exported as a Kaggle dataset; downstream notebooks load the model from /kaggle/input/....
  10. Submit the final submission-producing artifact to Kaggle for scoring and retrieve the resulting submission status/score.
  11. If Kaggle returns a code-competition error or vague scoring failure, enter the debugging loop: retrieve available logs, classify likely failure mode, patch defensively, rerun the final kernel, resubmit, and repeat until scored or concretely blocked.
  12. Track local CV, remote Kaggle run status, Kaggle submission score, public LB, private-risk notes, seed, code version, data version, and artifact paths for every run.
  13. Ensemble only with OOF predictions generated without in-fold leakage.

Resource Map

  • Read references/method-map.md for the neutral workflow map behind the skill.
  • Read references/information-sharing-policy.md before publishing competition code, notebooks, datasets, models, artifacts, or reports outside the active team or workspace.
  • Read references/competition-intel.md when a Kaggle competition slug, URL, title, public leaderboard context, open solutions, or discussion activity may inform the approach.
  • Read references/cross-validation-and-metrics.md when choosing folds, metrics, thresholds, or leakage checks.
  • Read references/tabular-workflow.md for categorical variables, feature engineering, selection, and hyperparameter tuning.
  • Read references/image-text-workflow.md for image, segmentation, and NLP competition approaches.
  • Read references/kaggle-code-competition-pipeline.md when the target is a Kaggle code competition, hidden rerun, final notebook scoring flow, or model artifact handoff between producer and consumer notebooks.
  • Read references/advanced-notebook-architecture.md when a stronger solution may need multiple model families, staged feature/embedding/model producers, pseudo-labeling, distillation, postprocessing, blending, stacking, or parallel Kaggle GPU notebooks.
  • Read references/kaggle-offload.md when local runs are heavy, GPU is useful, Kaggle data access is needed, or remote notebook results must be collected.
  • Read references/kaggle-pipeline-datasets.md when using multiple Kaggle notebooks, intermediate datasets, notebook output sources, or kagglehub.
  • Read references/submission-endgame.md before stopping work; this skill is not done until Kaggle scoring has been attempted and the result has been collected or a concrete blocker is documented.
  • Read references/code-competition-debugging.md when a Kaggle code competition submission fails, times out, OOMs, produces no score, or reports a vague hidden-run/scoring error.
  • Read references/ensembling-and-reproducibility.md for project layout, OOF artifacts, stacking, blending, and repeatability.
  • Read references/research/ or examples/ only when the user asks for historical case studies, Hermes-era patterns, or concrete competition lessons from this repository.
  • Run scripts/scaffold_competition.py to create a competition workspace.
  • Run scripts/make_folds.py to add a fold column to a training CSV.
  • Run scripts/prepare_kaggle_kernel.py to create a Kaggle kernel folder with metadata and retrievable experiment logs.
  • Run scripts/prepare_kaggle_dataset.py to create metadata and commands for versioned intermediate artifact datasets.

Default Kaggle Procedure

Start with the metric and validation:

  • Reproduce the competition metric locally, including clipping, transforms, averaging mode, thresholds, and sample weights.
  • Check whether the competition allows public code, external data, pretrained weights, generated artifacts, and public repositories before sharing anything outside the team.
  • Classify the Kaggle submission path early. If it is a code competition or notebook-scored workflow, design the final consumer notebook as the scoring artifact from the start.
  • Use kaggle-competition-intel MCP tools when available: top_open_solutions for score-ranked plus latest high-vote notebooks, and competition_discussions for top-voted plus recently active discussion topics before choosing expensive baselines.
  • Choose folds to match the hidden test distribution. Use stratification for classification, binned stratification for regression, group splits for repeated entities, time-aware splits for temporal data, and multilabel-aware splits when label co-occurrence matters.
  • Save OOF predictions for every model. OOF files are the currency for error analysis, threshold tuning, blending, and stacking.
  • Compare mean fold score and fold variance, not only the best fold.
  • Treat a public LB jump that disagrees with CV as a validation question before treating it as a modeling victory.

Then build baselines in this order:

  1. Metric-only or constant baseline to verify scoring and submission format.
  2. Fast classical baseline: LightGBM/CatBoost/XGBoost for tabular, TF-IDF plus linear model for text, pretrained backbone for images.
  3. Strong baseline with stable folds, clean artifacts, and OOF predictions.
  4. Feature/model experiments with run logs and one primary metric.
  5. Ensembling or stacking after several diverse, individually validated models exist.

Do not wait for the user to explicitly ask for sophistication when the competition warrants it. After a stable baseline, propose and execute a stronger staged architecture if public solutions, discussion intel, data modality, metric pressure, or CV plateau suggests that a single notebook/model will underperform. Keep the architecture gated by OOF evidence, artifact manifests, and final Kaggle scoring.

When a run is likely to exceed local RAM/VRAM, require a GPU/TPU, or needs Kaggle-only data mounts, prepare a Kaggle kernel run instead of forcing it locally. The remote run must emit experiment_log.json, metrics.jsonl, and an artifact manifest so results can be retrieved and interpreted after kaggle kernels output.

When the solution has multiple heavy stages, keep the remote graph shallow and inspectable:

  • Use fewer than five independent producer notebooks/scripts per wave.
  • Give each producer a single responsibility such as feature generation, embedding extraction, fold training, checkpoint training, model distillation, or inference.
  • For code competitions, prefer producer notebooks that train models/checkpoints and export them as private Kaggle datasets; the final consumer should attach those datasets, load models from /kaggle/input/..., and perform hidden-test-safe inference.
  • Save producer notebook outputs as versioned private Kaggle datasets for durable reuse and as stable inputs to downstream notebooks; use direct kernel_sources only for short-lived chains where durability/versioning is unnecessary.
  • Run one final consumer notebook/script that attaches the produced datasets, reads their artifacts, writes the final OOF, test predictions, blend/stack report, and submission, then submit that final artifact/kernel to Kaggle for scoring.
  • Use kagglehub inside Python when it is more convenient to download datasets, competition files, notebook outputs, or upload dataset versions programmatically.

Definition Of Done

Do not stop at a plan, scaffold, trained model, notebook run, downloaded output, or local validation score. Continue until one of these is true:

  • A competition submission has been sent to Kaggle, Kaggle has processed it, and the public score or submission status has been retrieved and recorded.
  • A code-competition final notebook/kernel has consumed all required producer artifacts, has been submitted with its kernel/version reference, and the resulting submission status/score has been retrieved and recorded.
  • A concrete external blocker prevents scoring: missing Kaggle credentials, rules not accepted, quota exhausted after retry attempts, competition closed, scoring disabled, required manual UI-only action, unavailable kernel version, or Kaggle service failure. Record the exact blocker and the next command/action needed.

Validation Choices

Use this quick mapping:

  • Balanced classification: StratifiedKFold.
  • Imbalanced classification: stratified folds plus metric-sensitive thresholding or class weights.
  • Regression: KFold for ordinary targets, binned stratified folds for skewed or multimodal targets.
  • Same user, patient, product, session, document, or image source appears multiple times: GroupKFold or stratified group splitting.
  • Ordered events or forecasting: time split, expanding-window validation, or competition-specific period split.
  • Images from same subject or scene: group by subject/scene before augmentation.
  • Text with duplicated sources, authors, questions, products, or prompts: group by source key.
  • Tiny data: repeated folds or more folds, but keep the final model selection discipline strict.

Modeling Priorities

  • For tabular competitions, prefer tree boosting first unless the data is mostly sparse text or high-cardinality categorical interactions. Add CatBoost when categorical columns are central.
  • For linear models and neural networks, scale numeric features and encode categoricals carefully.
  • For tree models, start with label/count/frequency encodings and sensible missing values; scaling is usually unnecessary.
  • For target encoding, always compute encodings out-of-fold, with smoothing and no validation-row target visibility.
  • For image tasks, get dataset, transforms, labels, masks, and metric correct before changing architecture.
  • For text tasks, keep a TF-IDF baseline even when using transformers; it is fast, interpretable, and often blends well.
  • For hyperparameter search, tune only after folds and baselines are trustworthy. Search learning rate, depth/leaves, regularization, sampling, and number of estimators with early stopping.

Competition Hygiene

  • Keep raw data read-only.
  • Keep competition data, private datasets, model checkpoints, downloaded outputs, submissions, credentials, and data-derived artifacts out of public Git repositories unless the competition rules and artifact licenses explicitly allow public redistribution.
  • Put all experiment-changing values in config or command-line args.
  • Seed Python, NumPy, framework, and model libraries when possible.
  • Save model files, OOF predictions, test predictions, fold scores, feature lists, and submission files with run IDs.
  • For Kaggle-offloaded jobs, write retrievable logs and artifacts into the notebook working directory, including run ID, git commit, config, fold, metric, hardware, elapsed time, OOM notes, and output file paths.
  • For multi-notebook pipelines, maintain a pipeline manifest with producer kernel refs, produced dataset refs, dataset versions, artifact schemas, metrics, and the final consumer run ID.
  • Keep producer datasets, kernels, and model artifacts private by default. Make them public only after verifying the target competition rules, data license, third-party IP, and user intent.
  • Record submission message, submission command or kernel/version, Kaggle submission timestamp, status, public score if available, and any error returned by Kaggle.
  • For vague code-competition failures, record the observed status, available logs, suspected failure class, patch attempted, and next retry command.
  • Never train a stacker on in-sample base predictions.
  • Never select features, target encoders, scalers, thresholds, or augmentations using validation targets outside the fold boundary.
  • Prefer scripts for repeatable training and notebooks for exploration and plots.

Useful Commands

Create a competition skeleton:

python3 <skill-dir>/scripts/scaffold_competition.py --root .

Create stratified folds:

python3 <skill-dir>/scripts/make_folds.py \
  --input input/train.csv \
  --output input/train_folds.csv \
  --target target \
  --strategy stratified \
  --n-splits 5

Create grouped folds:

python3 <skill-dir>/scripts/make_folds.py \
  --input input/train.csv \
  --output input/train_folds.csv \
  --target target \
  --group-col patient_id \
  --strategy group

Prepare a Kaggle GPU kernel experiment folder:

python3 <skill-dir>/scripts/prepare_kaggle_kernel.py \
  --output kaggle_kernels/exp_lgbm_gpu \
  --username kaggle-user \
  --slug exp-lgbm-gpu \
  --title "exp lgbm gpu" \
  --competition playground-series-sample \
  --accelerator NvidiaTeslaT4

Prepare a private Kaggle dataset folder for intermediate artifacts:

python3 <skill-dir>/scripts/prepare_kaggle_dataset.py \
  --output kaggle_datasets/exp_features_v1 \
  --username kaggle-user \
  --slug exp-features-v1 \
  --title "exp features v1" \
  --description "OOF-safe feature artifacts for experiment exp_features_v1"

Prepare a private Kaggle dataset folder for trained model artifacts:

python3 <skill-dir>/scripts/prepare_kaggle_dataset.py \
  --output kaggle_datasets/exp_model_v1 \
  --username kaggle-user \
  --slug exp-model-v1 \
  --title "exp model v1" \
  --description "Trained model artifacts for experiment exp_model_v1" \
  --artifact-kind model

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/kaggle-competition-automation-mrzxuruj/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/kaggle-competition-automation-mrzxuruj' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/kaggle-competition-automation-mrzxuruj/download' --output '.skill-downloads/kaggle-competition-automation-mrzxuruj/SKILL.md.part' && mv '.skill-downloads/kaggle-competition-automation-mrzxuruj/SKILL.md.part' '.skill-downloads/kaggle-competition-automation-mrzxuruj/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/kaggle-competition-automation-mrzxuruj/SKILL.md' && test -s '.skill-downloads/kaggle-competition-automation-mrzxuruj/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/agentic-kaggle-skill' && cp -R '.skill-downloads/kaggle-competition-automation-mrzxuruj' '.claude/skills/agentic-kaggle-skill'

Codex
test -f '.skill-downloads/kaggle-competition-automation-mrzxuruj/SKILL.md' && test -s '.skill-downloads/kaggle-competition-automation-mrzxuruj/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/agentic-kaggle-skill' && cp -R '.skill-downloads/kaggle-competition-automation-mrzxuruj' '.agents/skills/agentic-kaggle-skill'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/kaggle-competition-automation-mrzxuruj'

openskills read 'kaggle-competition-automation-mrzxuruj'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/kaggle-competition-automation-mrzxuruj/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires