param087/agent-ml-skills/hyperparameter-tuning
Claude Code and agent skill by param087/agent-ml-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when optimizing model hyperparameters. Covers search strategy (random vs Bayesian/Optuna), leakage-safe tuning inside CV, search-space design, early stopping, and budget management.
Install
npx vskill@latest install param087/agent-ml-skills/hyperparameter-tuningSKILL.md
The same SKILL.md was published earlier as param087/agent-ml-skills/hyperparameter-tuning.
Hyperparameter Tuning
Overview
Tuning squeezes the last 5-15% out of a model — but done carelessly it overfits the validation set and leaks preprocessing. The rules: tune the whole pipeline inside cross-validation, search smart (not grid), and keep a final untouched test set.
When to use
- A reasonable baseline exists and you want to improve it.
- You need to pick model complexity (depth, regularization, lr).
Strategy selection
| Situation | Method | |
|---|---|---|
| Few params, cheap model | GridSearchCV | |
| Many params / continuous | RandomizedSearchCV (often beats grid per compute) | |
| Expensive model, want efficiency | Bayesian / Optuna (TPE) | |
| Neural nets | Optuna + early stopping + pruning |
Optuna pattern (leakage-safe, prunes bad trials)
Note the clf__ prefix — you're tuning the estimator inside the pipeline, so preprocessing re-fits per fold.
Search-space design
- Sample learning rates and regularization on a log scale.
- Start wide, then narrow around the best region in a second study.
- Tie
n_estimatorsto early stopping rather than tuning it directly. - Fix the seed in the sampler for reproducible studies.
Budget management
- Set
timeoutandn_trialsceilings; use Optuna pruning to kill hopeless trials early. - Tune on a representative subsample first to find the region, then refine on full data.
- Don't tune dozens of params — pick the 3-5 that matter for your model family.
Pitfalls
- Nested leakage: preprocessing fit outside CV, then tuned — inflates scores. Tune the pipeline.
- Tuning on the test set — only ever touch train/validation; report final number on the holdout once.
- Over-tuning to a tiny validation set → great CV, worse production. Prefer simpler models + regularization.
- Comparing tuned-vs-untuned across different CV splits — keep the split fixed.
Hand-off
Best params + a refit pipeline, logged via experiment-tracking and scored once on the holdout via model-evaluation.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/hyperparameter-tuning/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/param087/agent-ml-skills/hyperparameter-tuning)