summarize-experiment
БесплатноБез исполняемых скриптовНе проверенCreate the standard summary of experiment results from a completed (fine-tuned and evaluated) experiment. Run this right after run-experiment as the required…
от niznik-dev★ 15 звёзд на GitHubОб этом скилле
Summarize Experiment
Generate a summary.md file capturing key metrics from a completed experiment. Think R's summary() for experiment results.
Your Task
Create the standard post-run summary of experiment results:
- Parse run status from experiment_summary.yaml
- Extract final training loss from SLURM stdout
- Extract accuracy from inspect-ai .eval files
- Generate summary.md in experiment directory
- Log the process in logs/summarize-experiment.log
Prerequisites
- experiment_summary.yaml exists
- At least some runs have completed (partial results acceptable)
- run-experiment has been executed (or manual SLURM jobs run)
- Conda environment activated - The
parse_eval_log.pyscript requires inspect-ai. Activate the conda environment fromclaude.local.mdbefore running extraction commands.
Workflow
1. Locate Experiment
Find the experiment directory:
- If in an experiment directory (contains experiment_summary.yaml): use current directory
- Otherwise: ask user for path
2. Parse Run Status
Read experiment_summary.yaml to identify runs:
From runs: section:
name: Run identifiertype: "fine-tuned" or "control"model: Model nameparameters: Dict of hyperparameters (empty for control runs)
From evaluation.matrix: section:
run: Run nametasks: List of evaluation task namesepochs: List of epochs to evaluate (null for control runs)
Determine status by checking filesystem:
- Fine-tuning: Check for
{experiment_dir}/{run_name}/artifacts/and SLURM outputs - Evaluation: Check for
{run_dir}/eval/*/logs/*.evalfiles
3. Extract Training Loss
For each COMPLETED fine-tuning run:
- Find SLURM stdout in the output directory:
- Read
experiment.dirfrom experiment_summary.yaml asexperiment_dir - Look in:
{experiment_dir}/{run_name}/artifacts/slurm-*.out - If multiple files, use most recent by modification time
- Read
- Extract final loss using
cruijff_kit.tools.torchtune.extract_loss:from cruijff_kit.tools.torchtune.extract_loss import final_loss result = final_loss(slurm_text) # returns (epoch, step, loss) or None- The canonical regex and helpers live in
src/tools/torchtune/extract_loss.py final_loss()returns the last match (epoch, step, loss) or Noneextract_losses()returns all matches as a list- The step number from the last match is the total training steps
- The canonical regex and helpers live in
- Record: run_name, final_loss, total_steps, epoch, step
Note: Training SLURM outputs are in the output directory, NOT the run directory. (Missing stdout → record N/A, continue; see Error Handling.)
4. Extract Evaluation Accuracy
For each COMPLETED evaluation:
- Find .eval files:
{run_dir}/eval/*/logs/*.eval - For each .eval file, run:
python -m cruijff_kit.tools.inspect.parse_eval_log {path} - Parse JSON output for the scorer's metrics (the
scorerfield tells you the type) - Map to epoch using SLURM job names (see below)
- Dispatch on scorer type:
- Binary classification (
match/exact_matchon 0/1 targets): also runsummary_binary.pyfor balanced accuracy and F1 (below). continuous_scorer(regression targets): runsummary_continuous.pyfor mae/rmse/r²/parse_rate and a prediction-distribution glance (below). Accuracy is not meaningful here — do not report it.risk_scorer(binary 0/1, but its CORRECT/INCORRECT is exact-string-match andsummary_binary.pycrashes on its.evalarchives): takeaccuracy/samplesfromparse_eval_logonly — do not runsummary_binary.pyon it. Argmax accuracy and format-compliance % are explore-experiment's job, not summarize's.
- Binary classification (
- Record the metrics appropriate to the scorer — classification → accuracy, balanced_accuracy, f1; regression → mae, rmse, r_squared, parse_rate. Always record run_name, task, epoch, samples.
Returns (JSON): consume task, accuracy, samples, scorer, model. The scorer field drives the dispatch in step 5; on failure it returns {"status": "error", "message": ...} (see Error Handling).
Mapping Epochs via SLURM Job Names
The .eval files don't currently store epoch information directly. To reliably map each evaluation to its epoch:
- Find SLURM output files in the eval directory:
{run_dir}/eval/slurm-*.out - Extract job IDs from filenames (e.g.,
slurm-2773062.out→ job ID 2773062) - Query job names via sacct:
sacct -j {job_ids} --format=JobID,JobName%50 - Parse epoch from the job name — scaffold-inspect names eval jobs
eval-{task}-ep{N}(oreval-{task}for a base run with no epoch). The run is identified by which{run_dir}/eval/the slurm file sits in, not by the job name:eval-acs_income-ep0→ epoch 0eval-acs_income-ep9→ epoch 9
Reliable regardless of submission order, timing, or resubmissions — the epoch comes from the scaffold-set job name, never from
Установить summarize-experiment в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл summarize-experiment?
Create the standard summary of experiment results from a completed (fine-tuned and evaluated) experiment. Run this right after run-experiment as the required post-run step — captures key metrics (loss, accuracy, regression metrics) into summary.md.
Как установить скилл summarize-experiment?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл summarize-experiment запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic