Agent skill

Hyperparameter Tuning

by seb1n in seb1n/awesome-ai-agent-skills

Optimize machine learning model hyperparameters using grid search, random search, Bayesian optimization, and Hyperband to maximize model performance within a compute budget.

MITAuto-check passedData & Analytics

Install Hyperparameter Tuning

skills CLI
$ npx skills add seb1n/awesome-ai-agent-skills --skill hyperparameter-tuning -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install seb1n/awesome-ai-agent-skills hyperparameter-tuning --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/seb1n/awesome-ai-agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/ai-ml-operations/hyperparameter-tuning .claude/skills/hyperparameter-tuning && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
hyperparameter-tuning
GitHub stars
206
Token cost
~2.3k tokens
SKILL.md length
714 words
Files
1
Skills in repo
92
Repo updated
First seen
Licence
MIT

At a glance

Optimize machine learning model hyperparameters using grid search, random search, Bayesian optimization, and Hyperband to maximize model performance within a compute budget.

  • Works in 5 steps: Define the search space: Specify each… → Select the search strategy: Choose the… → Configure evaluation: Set up k-fold… → …
  • The user requests hyperparameter tuning
  • SKILL.md covers Workflow, Supported Technologies, Usage and Examples, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Hyperparameter Tuning is an agent skill from seb1n/awesome-ai-agent-skills. Optimize machine learning model hyperparameters using grid search, random search, Bayesian optimization, and Hyperband to maximize model performance within a compute budget. Use when the user requests hyperparameter tuning or provides relevant inputs for this workflow.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Data & Analytics, covering Machine learning. The repository describes itself as: 103 ready-to-use AI agent skills for Claude Code, OpenAI Codex, Gemini CLI, Cursor, GitHub Copilot, Windsurf, and other Agent Skills-compatible tools. Complete SKILL.md… The licence is MIT.

When your agent uses it

  • The user requests hyperparameter tuning
  • Provides relevant inputs for this workflow

Example prompts

  • “/hyperparameter-tuning”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Define the search space: Specify each hyperparameter with its type (categorical, integer, float) and range. Use log-uniform distributions…
  2. Select the search strategy: Choose the tuning algorithm based on compute budget and search space size. Grid search is exhaustive but only…
  3. Configure evaluation: Set up k-fold cross-validation (typically 5-fold) for reliable performance estimates on small to medium datasets…
  4. Run trials with pruning: Execute the search, launching trials in parallel when possible. Enable pruning to terminate underperforming…
  5. Analyze and select results: Inspect the optimization history to understand which hyperparameters matter most (importance analysis)…

What it can do on your machine

Read from SKILL.md and the folder at commit 75865a5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Hyperparameter Tuning loads about 2.3k tokens when it runs. Until then it costs about 73 tokens; SKILL.md has 714 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~73
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from seb1n/awesome-ai-agent-skills at commit 75865a5, republished under its MIT licence (© seb1n). 714 words, ~2,326 tokens.

Download SKILL.mdSave it as .claude/skills/hyperparameter-tuning/SKILL.md (or your agent's skills folder).
name
hyperparameter-tuning
description
Optimize machine learning model hyperparameters using grid search, random search, Bayesian optimization, and Hyperband to maximize model performance within a compute budget. Use when the user requests hyperparameter tuning or provides relevant inputs for this workflow.
license
MIT
metadata.author
AI Agent Skills
metadata.version
1.0.0

Hyperparameter Tuning

This skill enables an AI agent to systematically search for optimal hyperparameter configurations for machine learning models. It covers defining search spaces, selecting search strategies (grid, random, Bayesian, Hyperband), running trials with cross-validation, applying early stopping to prune poor configurations, and analyzing results to identify the best-performing parameters. The agent balances exploration and exploitation to find strong configurations within a given computational budget.

Workflow

  1. Define the search space: Specify each hyperparameter with its type (categorical, integer, float) and range. Use log-uniform distributions for parameters that span orders of magnitude (e.g., learning rate from 1e-5 to 1e-1). Group related parameters and define conditional search spaces where certain parameters only apply when others take specific values.

  2. Select the search strategy: Choose the tuning algorithm based on compute budget and search space size. Grid search is exhaustive but only feasible for small spaces. Random search is a strong baseline that scales better. Bayesian optimization (Tree-structured Parzen Estimators or Gaussian Processes) is most sample-efficient for expensive evaluations. Hyperband and ASHA combine early stopping with random search for deep learning workloads.

  3. Configure evaluation: Set up k-fold cross-validation (typically 5-fold) for reliable performance estimates on small to medium datasets. For large datasets or expensive models, use a single holdout validation set. Define the objective metric to optimize (e.g., validation F1, AUC-ROC, RMSE) and whether to minimize or maximize it.

  4. Run trials with pruning: Execute the search, launching trials in parallel when possible. Enable pruning to terminate underperforming trials early based on intermediate results (e.g., after a few epochs of training), freeing compute for more promising configurations.

  5. Analyze and select results: Inspect the optimization history to understand which hyperparameters matter most (importance analysis). Visualize parameter interactions with contour plots or parallel coordinate plots. Select the best configuration and retrain the final model on the full training set with those parameters.

Supported Technologies

  • Frameworks: Optuna, Ray Tune, scikit-learn GridSearchCV/RandomizedSearchCV, Hyperopt, Keras Tuner
  • Pruning algorithms: Median pruning, Hyperband (Successive Halving), ASHA
  • Bayesian methods: TPE (Tree-structured Parzen Estimators), GP (Gaussian Process), CMA-ES
  • Visualization: Optuna visualization (plotly), TensorBoard HParams, Weights & Biases Sweeps
  • Distributed execution: Ray Tune cluster, Optuna with distributed storage (MySQL, PostgreSQL)

Usage

Provide the agent with the model, dataset, the hyperparameters to tune with their ranges, a compute budget (number of trials or wall-clock time), and the target metric. The agent will execute the tuning workflow and return the best hyperparameter configuration along with performance analysis.

Examples

Example 1: Optuna Study for Tuning a Random Forest
python
import optuna
from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import cross_val_score
import numpy as np

X, y = load_breast_cancer(return_X_y=True)

def objective(trial):
    params = {
        "n_estimators": trial.suggest_int("n_estimators", 50, 500, step=50),
        "max_depth": trial.suggest_int("max_depth", 3, 30),
        "min_samples_split": trial.suggest_int("min_samples_split", 2, 20),
        "min_samples_leaf": trial.suggest_int("min_samples_leaf", 1, 10),
        "max_features": trial.suggest_categorical("max_features", ["sqrt", "log2", None]),
        "criterion": trial.suggest_categorical("criterion", ["gini", "entropy"]),
    }
    clf = RandomForestClassifier(**params, random_state=42, n_jobs=-1)
    scores = cross_val_score(clf, X, y, cv=5, scoring="f1")
    return scores.mean()

study = optuna.create_study(direction="maximize", sampler=optuna.samplers.TPESampler(seed=42))
study.optimize(objective, n_trials=100, show_progress_bar=True)

print(f"Best F1: {study.best_value:.4f}")
print(f"Best params: {study.best_params}")

# Visualization
fig_importance = optuna.visualization.plot_param_importances(study)
fig_history = optuna.visualization.plot_optimization_history(study)
fig_contour = optuna.visualization.plot_contour(study, params=["n_estimators", "max_depth"])
Example 2: Ray Tune for Neural Network with Early Stopping
python
import torch
import torch.nn as nn
from torch.utils.data import DataLoader, TensorDataset, random_split
from ray import tune
from ray.tune.schedulers import ASHAScheduler
from ray.air import session
import numpy as np

def train_nn(config):
    X = torch.randn(2000, 20)
    y = (X[:, 0] + X[:, 1] * 2 > 0).long()
    dataset = TensorDataset(X, y)
    train_set, val_set = random_split(dataset, [1600, 400])
    train_loader = DataLoader(train_set, batch_size=config["batch_size"], shuffle=True)
    val_loader = DataLoader(val_set, batch_size=256)

    model = nn.Sequential(
        nn.Linear(20, config["hidden_size"]),
        nn.ReLU(),
        nn.Dropout(config["dropout"]),
        nn.Linear(config["hidden_size"], config["hidden_size"] // 2),
        nn.ReLU(),
        nn.Linear(config["hidden_size"] // 2, 2),
    )
    optimizer = torch.optim.Adam(model.parameters(), lr=config["lr"], weight_decay=config["weight_decay"])
    criterion = nn.CrossEntropyLoss()

    for epoch in range(50):
        model.train()
        for xb, yb in train_loader:
            loss = criterion(model(xb), yb)
            optimizer.zero_grad()
            loss.backward()
            optimizer.step()

        model.eval()
        correct, total = 0, 0
        with torch.no_grad():
            for xb, yb in val_loader:
                correct += (model(xb).argmax(1) == yb).sum().item()
                total += yb.size(0)
        session.report({"val_accuracy": correct / total})

search_space = {
    "hidden_size": tune.choice([64, 128, 256]),
    "lr": tune.loguniform(1e-4, 1e-1),
    "dropout": tune.uniform(0.1, 0.5),
    "batch_size": tune.choice([32, 64, 128]),
    "weight_decay": tune.loguniform(1e-5, 1e-2),
}

scheduler = ASHAScheduler(max_t=50, grace_period=5, reduction_factor=3)
result = tune.run(
    train_nn,
    config=search_space,
    num_samples=50,
    scheduler=scheduler,
    metric="val_accuracy",
    mode="max",
    resources_per_trial={"cpu": 2},
)

print(f"Best config: {result.best_config}")
print(f"Best val accuracy: {result.best_result['val_accuracy']:.4f}")
Show full SKILL.md (290 more words)Show less

Best Practices

  • Use log-uniform distributions for learning rate, weight decay, and regularization strength since optimal values often span multiple orders of magnitude.
  • Start with random search to quickly identify promising regions of the search space before switching to Bayesian optimization for fine-grained exploration.
  • Enable early stopping / pruning to avoid wasting compute on configurations that clearly underperform after a few epochs.
  • Always use cross-validation for the objective score on small datasets (< 50k samples) to reduce variance in performance estimates and avoid overfitting to a single validation split.
  • Run hyperparameter importance analysis after tuning to understand which parameters actually matter — often only 2-3 parameters drive most of the performance difference.
  • Set a compute budget upfront (number of trials, GPU-hours, or wall-clock time) and choose the search strategy that makes the best use of that budget.

Edge Cases

  • Huge search spaces (> 10 dimensions): Bayesian optimization degrades with high dimensionality. Use random search or Hyperband as a first pass, then run Bayesian optimization on the top 3-5 most important parameters identified from the first pass.
  • Noisy objectives: When cross-validation scores have high variance, a single trial result is unreliable. Increase the number of CV folds, use repeated k-fold, or average over multiple seeds before comparing configurations.
  • Correlated hyperparameters: Some hyperparameters interact strongly (e.g., learning rate and batch size). Use Optuna's contour plots or fANOVA importance to detect interactions and consider tuning correlated groups together.
  • Expensive evaluations (> 1 hour per trial): Use multi-fidelity methods like Hyperband that train with small budgets first and only promote promising configurations to full training. Also consider surrogate benchmarks or smaller proxy datasets for initial screening.
  • Categorical explosion: When multiple categorical hyperparameters create a combinatorial explosion, use conditional search spaces to prune invalid combinations and reduce the effective space size.

© seb1n, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in ai-ml-operations/hyperparameter-tuning of seb1n/awesome-ai-agent-skills.

Open the folder on GitHubat commit 75865a5

Compare with similar skills

Hyperparameter Tuning next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Hyperparameter Tuning compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Hyperparameter Tuning this skillseb1n/awesome-ai-agent-skills206—~2.3kAutomated safety check: PassMIT
Scikit LearnzLanqing/codex-claude-academic-skills4.6k17 repos~3.9kAutomated safety check: PassBSD-3-Clause
Senior Data ScientistRaidriar7170/hermes-skilleval1256 repos~1.4kAutomated safety check: PassMIT
Agentic Kaggle WorkflowFrankS-IntelLab/agentic-kaggle-skill188—~4kAutomated safety check: PassMIT
Retention Analysisliangdabiao/claude-data-analysis-ultra-main2901 repos~1.3kAutomated safety check: NotesNone
Geomlitalo-goncalves/geoML108—~4.2kAutomated safety check: PassGPL-3.0

Similar skills

  • Scikit Learn

    zLanqing/codex-claude-academic-skills

    Machine learning in Python with scikit-learn. An agent skill from zLanqing/codex-claude-academic-skills.

    4.6k GitHub starsUsed in 17 repos~3.9k tokens
    Data & AnalyticsAuto-check passed
  • Senior Data Scientist

    Raidriar7170/hermes-skilleval

    World-class data science skill for statistical modeling, experimentation, causal inference, and advanced analytics.

    125 GitHub starsUsed in 6 repos~1.4k tokens
    Data & AnalyticsAuto-check passed
  • Agentic Kaggle Workflow

    FrankS-IntelLab/agentic-kaggle-skill

    Takes a Kaggle competition from rules and validation design through baselines, ensembling and notebook architecture to a scored submission.

    188 GitHub stars~4k tokensUpdated 3 mo ago
    Data & AnalyticsAuto-check passed
  • Retention Analysis

    liangdabiao/claude-data-analysis-ultra-main

    Analyze user retention and churn using survival analysis, cohort analysis, and machine learning.

    290 GitHub starsUsed in 1 repo~1.3k tokens
    Data & AnalyticsAuto-check: notes
  • Geoml

    italo-goncalves/geoML

    Working knowledge of the geoML Python package (github.com/italo-goncalves/geoML): variational Gaussian processes for spatial data, implicit geological modelling, block models, drillhole data…

    108 GitHub stars~4.2k tokensUpdated 5 days ago
    Data & AnalyticsAuto-check passed
  • Radiomics ML

    Aperivue/medsci-skills

    A skill your agent uses when building or auditing a radiomics or tabular clinical-ML prediction model with a classical learner (LASSO, SVM, random forest, XGBoost and similar).

    329 GitHub starsUsed in 1 repo~2.7k tokens
    Data & AnalyticsAuto-check passed

More from seb1n/awesome-ai-agent-skills

All 92 skills in this repo
  • Agent Red Teaming

    seb1n/awesome-ai-agent-skills

    Plan, execute, document, and retest authorized security assessments of AI agents and multi-agent workflows using safe adversarial cases, synthetic identities, canaries, and evidence-based findings.

    206 GitHub stars~2.8k tokensUpdated 1 mo ago
    Auto-check passed
  • Eu AI Act Readiness

    seb1n/awesome-ai-agent-skills

    Build a preliminary, evidence-based EU AI Act readiness assessment across AI-system inventory, territorial scope, operator roles, prohibited-practice screening, risk classification, transparency…

    206 GitHub stars~3.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Human In The Loop

    seb1n/awesome-ai-agent-skills

    Design and verify auditable human oversight, approval gates, escalation paths, and safe state transitions for AI agent workflows.

    206 GitHub stars~2.5k tokensUpdated 1 mo ago
    Auto-check passed
  • MCP Server Building

    seb1n/awesome-ai-agent-skills

    Design, implement, harden, and verify Model Context Protocol (MCP) servers with precise tool contracts, least-privilege authorization, safe transports, structured errors, and interoperability tests.

    206 GitHub stars~2.5k tokensUpdated 1 mo ago
    Auto-check passed
  • PDF Processing

    seb1n/awesome-ai-agent-skills

    Inspect, extract, OCR, create, merge, split, reorder, rotate, annotate, fill, redact, compress, secure, and verify PDF documents while preserving source files and visual fidelity.

    206 GitHub stars~2.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Skill Supply Chain Audit

    seb1n/awesome-ai-agent-skills

    Audit agent skills, plugins, prompts, manifests, scripts, dependencies, and bundled assets for provenance, prompt-injection, permission, execution, exfiltration, persistence, and update risk.

    206 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Hyperparameter Tuning

What does Hyperparameter Tuning do?

Optimize machine learning model hyperparameters using grid search, random search, Bayesian optimization, and Hyperband to maximize model performance within a compute budget. Hyperparameter Tuning is an agent skill from seb1n/awesome-ai-agent-skills. Optimize machine learning model hyperparameters using grid search, random search, Bayesian optimization, and Hyperband to maximize model performance within a compute budget.

When should I use Hyperparameter Tuning?

Hyperparameter Tuning fits situations like: the user requests hyperparameter tuning; provides relevant inputs for this workflow.

How do I install Hyperparameter Tuning in Claude Code?

Run `npx skills add seb1n/awesome-ai-agent-skills --skill hyperparameter-tuning -a claude-code`. Or copy the skill folder (ai-ml-operations/hyperparameter-tuning in seb1n/awesome-ai-agent-skills) into .claude/skills/hyperparameter-tuning in your project. Claude Code loads it when a task matches its description.

How do I install Hyperparameter Tuning in Codex?

Run `npx skills add seb1n/awesome-ai-agent-skills --skill hyperparameter-tuning -a codex`. Or copy the skill folder (ai-ml-operations/hyperparameter-tuning in seb1n/awesome-ai-agent-skills) into .agents/skills/hyperparameter-tuning in your project. Codex loads it when a task matches its description.

Can I use Hyperparameter Tuning in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add seb1n/awesome-ai-agent-skills --skill hyperparameter-tuning -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/hyperparameter-tuning, .gemini/skills/hyperparameter-tuning, .github/skills/hyperparameter-tuning and .opencode/skills/hyperparameter-tuning in your project.

What does Hyperparameter Tuning need to run?

SKILL.md names no scripts, command-line tools or credentials: Hyperparameter Tuning is instructions for the agent only. Our summary lists: Python 3.

Does Hyperparameter Tuning access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Hyperparameter Tuning safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Hyperparameter Tuning use?

Hyperparameter Tuning is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Hyperparameter Tuning use?

About 2.3k tokens (SKILL.md is roughly 9.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Hyperparameter Tuning?

Skills that share tags, products or a category with Hyperparameter Tuning: Scikit Learn (zLanqing/codex-claude-academic-skills, 4.6k stars), Senior Data Scientist (Raidriar7170/hermes-skilleval, 125 stars), Agentic Kaggle Workflow (FrankS-IntelLab/agentic-kaggle-skill, 188 stars) and Retention Analysis (liangdabiao/claude-data-analysis-ultra-main, 290 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Hyperparameter Tuning?

seb1n (a GitHub user) maintains it in seb1n/awesome-ai-agent-skills, which has 206 GitHub stars. The repository holds 92 skills in this directory. The repository was last updated on August 9, 2026.

Source: seb1n/awesome-ai-agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.