hyperparameter-tuning

hyperparameter-tuning is a skill for Claude Code, Codex from param087/agent-ml-skills. It costs 40 tokens per session (741 once invoked), scanned A, original, MIT.

A guide to choosing the settings that control how a machine-learning model learns, such as its depth, learning rate, or regularization.

In plain words
What is it for?
Use it after building a reasonable baseline when you need to compare grid, random, or Bayesian searches, tune a full pipeline, use cross-validation, or stop unpromising trials early.
Why use it?
It helps improve a model without accidentally tailoring it too closely to the validation data. It covers ways to search settings efficiently and keep the final test set independent.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/param087/agent-ml-skills/hyperparameter-tuning
Any agent
npx skills add param087/agent-ml-skills --skill hyperparameter-tuning
Clone the repo
git clone --depth 1 https://github.com/param087/agent-ml-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for hyperparameter-tuning

README.md
[![agentmods](https://agentmods.dev/badge/skills/param087/agent-ml-skills/hyperparameter-tuning.svg)](https://agentmods.dev/skills/param087/agent-ml-skills/hyperparameter-tuning)
Your own site
<a href="https://agentmods.dev/skills/param087/agent-ml-skills/hyperparameter-tuning"><img src="https://agentmods.dev/badge/skills/param087/agent-ml-skills/hyperparameter-tuning.svg" alt="Measured on agentmods" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 741 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00040 $0.00741
Opus 5 $0.00020 $0.00370
Sonnet 5 $0.00008 $0.00148
Haiku 4.5 $0.00004 $0.00074

Measured 4d ago against content hash 11ec88b53c0b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

hyperparameter-tuning scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/hyperparameter-tuning/SKILL.md · 75 lines

How it starts

The opening of the file, as written. The whole thing — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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)

import optuna
from sklearn.model_selection import cross_val_score, StratifiedKFold

cv = StratifiedKFold(5, shuffle=True, random_state=42)

def objective(trial):
    params = {
        "clf__learning_rate": trial.suggest_float("lr", 1e-3, 0.3, log=True),
        "clf__max_depth": trial.suggest_int("max_depth", 3, 12),
        "clf__l2_regularization": trial.suggest_float("l2", 1e-3, 10, log=True),
    }
    model.set_params(**params)
    scores = cross_val_score(model, X_train, y_train, cv=cv, scoring="roc_auc")
    return scores.mean()

study = optuna.create_study(direction="maximize",
                            sampler=optuna.samplers.TPESampler(seed=42))
study.optimize(objective, n_trials=50, timeout=1800)
print(study.best_params, study.best_value)

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_estimators to early stopping rather than tuning it directly.
  • Fix the seed in the sampler for reproducible studies.

Budget management

Read the full file on GitHub · 75 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 75 lines · 40 tokens per session scan A 11ec88b53c0b

Subscribe to this mod's changes

hyperparameter-tuning is a skill published in the GitHub repository param087/agent-ml-skills (9 stars, last pushed 3mo ago), licensed MIT. It adds 40 tokens to every session and 741 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

stock-data-fetch

Fetch multi-market financial data — US (FMP→Finnhub), A/HK (Tencent→Sina), crypto (OKX→Hyperliquid), commodities (Hyperliquid+Finnhub), news (Marketaux), backup (Longbridge). Battle-tested in restricted network environments.

realnaka/alphaloop · 62 tokens

data-scientist

数据分析全流程:数据画像、统计检验、可视化、报告生成。三阶段流程(数据摄入→分析执行→报告生成),单 agent 完成,无需多 agent 编排。当用户提到 CSV/Excel/Parquet 数据分析、假设检验、统计报告、制造业分析(良率/SPC/Cpk)、A/B 测试、或数据质量问题诊断时使用。.

realnghon/data-scientist · 95 tokens

auth-web-cloudbase

CloudBase Web Authentication Quick Guide for frontend integration after auth-tool has already been checked. Provides concise and practical Web authentication solutions with multiple login methods and complete user management.

TencentCloudBase/CloudBase-AI-Toolkit · 38 tokens

browse-and-evaluate

Use when exploring the ai-agent-skills catalog to find, compare, and evaluate skills before installing. Always use --fields to limit output size and --dry-run before committing to an install.

MoizIbnYousaf/Ai-Agent-Skills · 43 tokens

loop-engineering

Shared loop-engineering reference for COG skills - the agent loop, deterministic verifiers, termination conditions, in-loop context management, and named patterns. Invoke when designing or debugging a skill that iterates (search-verify-retry, scan-until-dry, fetch-retry-gate).

huytieu/COG-second-brain · 63 tokens

telnyx-messaging-hosted-curl

Set up hosted SMS numbers, toll-free verification, and RCS messaging. Use when migrating numbers or enabling rich messaging features. This skill provides REST API (curl) examples.

team-telnyx/ai · 45 tokens