Command Palette

Search for a command to run...

Back to skills
skill № 74582

ml-hyperparameter-tuning

Use when the user asks about hyperparameter tuning with Optuna, Ray Tune or Hyperopt, search spaces, Bayesian/TPE vs random search, pruning, early stopping or…

FreeNo executable scripts
j4flmaoby j4flmao★ 47 GitHub stars

Install ml-hyperparameter-tuning in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

ML Hyperparameter Tuning

Purpose

Design hyperparameter tuning pipelines with structured search spaces, optimal strategy selection, and production-ready framework configuration.

Architecture/Decision Trees

Strategy Selection Decision Tree

How long does each trial take?
  ├── <10 seconds
  │   ├── <4 hyperparameters → Grid Search (exhaustive)
  │   └── >4 hyperparameters → Random Search (better coverage)
  ├── 10 seconds - 1 minute
  │   └── Bayesian Optimization (TPE or GP)
  ├── 1 minute - 1 hour
  │   ├── Bayesian + ASHA Pruning (aggressive early stopping)
  │   └── Hyperband (adaptive resource allocation)
  └── >1 hour
      ├── Population-Based Training (evolve HP + weights)
      └── Bayesian with aggressive pruning + checkpoint reuse

Search Space Scale Decision Tree

How many trials can you afford?
  ├── <20 trials → Manual tuning or grid on 2-3 key params
  ├── 20-100 trials → Random Search or Bayesian (TPE)
  ├── 100-1000 trials → Bayesian (GP/SMAC) + Median Pruner
  ├── 1000-10000 trials → Hyperband + Distributed (Ray)
  └── >10000 trials → Population-Based Training

Parameter Scale Decision Tree

What type of hyperparameter?
  ├── Learning rate, regularization, weight decay
  │   └── Log-uniform scale (trial.suggest_float(..., log=True))
  ├── Tree depth, number of layers, batch size, hidden units
  │   └── Integer uniform (trial.suggest_int)
  ├── Optimizer, activation, pooling type
  │   └── Categorical (trial.suggest_categorical)
  └── Conditional (momentum only when optimizer==sgd)
      └── if/else branching in objective function

Pruning Strategy Decision Tree

├── <10 trials budget → No pruning (too few to prune reliably)
├── 10-100 trials → MedianPruner (n_warmup_steps=10)
├── 100-1000 trials → ASHA (async, distributed-friendly)
└── >1000 trials → Hyperband (multi-bracket resource allocation)

Agent Protocol

Trigger

User request includes: hyperparameter tuning, Optuna, Ray Tune, Hyperopt, grid search, random search, Bayesian optimization, pruning, early stopping.

Input Context

Before activating, verify:

  • Model type and training pipeline.
  • Approximate training time per trial.
  • Available compute resources (single machine, multi-core, multi-GPU, cluster).
  • Which hyperparameters are known to matter.
  • Whether cross-validation is needed inside each trial.
  • Whether the objective function is deterministic or stochastic.

Output Artifact

Hyperparameter tuning setup with search space design, strategy selection, framework configuration, pruning policy, and distributed execution plan.

Response Format

## Tuning Config
### Search Space
Param: {name} | Type: {float/int/categorical} | Range: [{min}, {max}] | Scale: {linear/log}

### Strategy
Method: {grid / random / Bayesian / TPE / CMA-ES}
Budget: {N trials} | Parallel: {N workers} | Timeout: {duration}

### Framework
Tool: {Optuna / Ray Tune / Hyperopt}
Study: {name} | Direction: {minimize / maximize}
Metric: {metric_name} | Pruning: {none / median / Hyperband / ASHA}

No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output.

Completion Criteria

  • Search space defined with all tunable parameters, distributions, and scales.
  • Search strategy selected based on trial budget and dimensionality.
  • Tuning framework configured with study/trial lifecycle.
  • Pruning policy set with minimum budget checks.
  • Distributed execution configured with fault tolerance.
  • Result persistence configured.
  • Random seed set for reproducibility.
  • Parameter importance analysis planned after tuning.

Workflow

Step 1: Search Space Definition

Use log-uniform for positive-valued parameters spanning orders of magnitude (learning rate 1e-5 to 1e-1, regularization 1e-4 to 1e-1). Use uniform for bounded additive parameters (depth 3-15, units 32-512). Use categorical for discrete options (optimizer, activation). Define conditional spaces where parameters depend on other choices.

import optuna

def create_search_space(trial, model_type="xgboost"):
    if model_type == "xgboost":
        return {
            "n_estimators": trial.suggest_int("n_estimators", 50, 1000),
            "max_depth": trial.suggest_int("max_depth", 3, 15),
            "learning_rate": trial.suggest_float("learning_rate", 1e-3, 0.3, log=True),
            "subsample": trial.suggest_float("subsample", 0.5, 1.0),
            "colsample_bytree": trial.suggest_float("colsample_bytree", 0.3, 1.0),
            "min_child_weight": trial.suggest_int("min_child_weight", 1, 10),
            "reg_alpha": trial.suggest_float("reg_alpha", 1e-4, 10.0, log=True),
            "reg_lambda": trial.suggest_float("reg_lambda", 1e-4, 10.0, log=True),
        }
    elif model_type == "neural_network":
        n_layers = trial.suggest_int("n_layers", 1, 5)
        params = {
            "learning_rate": trial.suggest_float("learning_rate", 1e-5, 1e-1, log=Tr
Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

  • references/automl-tuning.md
  • references/hyperparameter-tuning-advanced.md
  • references/hyperparameter-tuning-fundamentals.md
  • references/multi-fidelity.md
  • references/optimization-methods.md
  • references/search-strategies.md
  • references/tuning-at-scale.md
  • references/tuning-frameworks.md

FAQ

What does the ml-hyperparameter-tuning skill do?

Use when the user asks about hyperparameter tuning with Optuna, Ray Tune or Hyperopt, search spaces, Bayesian/TPE vs random search, pruning, early stopping or multi-objective tuning. Produces search space, sampler and pruner config and distributed execution plan. Not for evaluation protocol (use ml-model-evaluation) or NAS.

How do I install the ml-hyperparameter-tuning skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the ml-hyperparameter-tuning skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare ml-hyperparameter-tuning with