hyperparameter-tuning — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited hyperparameter-tuning (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
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.
| 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 |
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.
n_estimators to early stopping rather than tuning it directly.timeout and n_trials ceilings; use Optuna pruning to kill hopeless trials early.Best params + a refit pipeline, logged via experiment-tracking and scored once on the holdout via model-evaluation.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.