model-training

A guide to training and comparing machine-learning classifiers or regressors with scikit-learn, including data preparation, cross-validation, tuning, and evaluation.

In plain words
What is it for?
Use it to build complete pipelines, run cross-validation, tune parameters with GridSearchCV or RandomizedSearchCV, compare against simple baselines, evaluate results, and save models with joblib.
Why use it?
It provides a repeatable way to test models and choose settings using held-out data instead of relying on a single training result.

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/bdiasti/maestro-bundle-cli/model-training
Any agent
npx skills add bdiasti/maestro-bundle-cli --skill model-training
Clone the repo
git clone --depth 1 https://github.com/bdiasti/maestro-bundle-cli

Made for: Claude Code, Codex.

Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,472 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.00052 $0.01472
Opus 5 $0.00026 $0.00736
Sonnet 5 $0.00010 $0.00294
Haiku 4.5 $0.00005 $0.00147

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

Security

Grade A, and why

model-training 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 3d 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.

templates/bundle-data-pipeline/skills/model-training/SKILL.md · 188 lines

How it starts

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

Model Training

Train, evaluate, and export ML models using scikit-learn pipelines with proper cross-validation and hyperparameter tuning.

When to Use

  • User wants to train a classification or regression model
  • User needs cross-validation scores for model selection
  • User wants to tune hyperparameters with GridSearch or RandomizedSearch
  • User needs to compare a model against a baseline
  • User wants to save a trained model for deployment

Available Operations

  1. Build a full sklearn Pipeline (preprocessing + model)
  2. Run cross-validation with multiple scoring metrics
  3. Tune hyperparameters with GridSearchCV or RandomizedSearchCV
  4. Evaluate on held-out test set with classification_report / regression metrics
  5. Compare against baseline (DummyClassifier/DummyRegressor)
  6. Save the best model with joblib

Multi-Step Workflow

Step 1: Install Dependencies

pip install scikit-learn pandas numpy joblib

Step 2: Load Prepared Data

import pandas as pd
from sklearn.model_selection import train_test_split

df = pd.read_parquet("data/processed/dataset_clean.parquet")
X = df.drop(columns=["target"])
y = df["target"]

X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.2, random_state=42, stratify=y  # stratify for classification
)
print(f"Train: {X_train.shape}, Test: {X_test.shape}")
print(f"Class distribution:\n{y_train.value_counts(normalize=True)}")

Step 3: Build Preprocessing + Model Pipeline

from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler, OneHotEncoder
from sklearn.compose import ColumnTransformer
from sklearn.ensemble import RandomForestClassifier

numeric_features = ["age", "salary", "experience"]
categorical_features = ["department", "role"]

preprocessor = ColumnTransformer(
    transformers=[
        ("num", StandardScaler(), numeric_features),
        ("cat", OneHotEncoder(handle_unknown="ignore"), categorical_features),
    ]
)

pipeline = Pipeline([
    ("preprocessor", preprocessor),
    ("classifier", RandomForestClassifier(random_state=42)),
])

Read the full file on GitHub · 188 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 188 lines · 52 tokens per session scan A fe1c354c33e0

Subscribe to this mod's changes

model-training is a skill published in the GitHub repository bdiasti/maestro-bundle-cli (21 stars, last pushed 5mo ago), licensed MIT. It adds 52 tokens to every session and 1,472 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories

cuml-machine-learning

Use for GPU-accelerated machine learning on tabular data using NVIDIA cuML. Triggers when tasks involve classification, regression, clustering, dimensionality reduction, or model training on datasets.

langchain-ai/deepagents · 43 tokens

geniml

Use Geniml for audited local genomic-interval workflows: validate BED and universe contracts, plan Region2Vec or scEmbed runs, inspect model/tokenizer compatibility, and assess consensus universes.

K-Dense-AI/scientific-agent-skills · 43 tokens

cellxgene-census

Query the CZ CELLxGENE Census programmatically for versioned public single-cell and spatial transcriptomics data. Use when you need population-scale cell metadata, gene expression slices, Census summary counts, source H5AD URIs/downloads, embeddings, spatial Census data, or reference atlas comparisons across…

K-Dense-AI/scientific-agent-skills · 97 tokens

arboreto

Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for…

K-Dense-AI/scientific-agent-skills · 66 tokens

deepspot-m

Generate transcriptome-wide virtual spatial transcriptomics from H&E histology with DeepSpot-M. Use when you need spatial gene expression in log1p-CPM for 224x224 tiles at about 20x, want to query protein-coding genes by symbol instead of a fixed panel, or want to run prediction across a whole slide after tiling with…

K-Dense-AI/scientific-agent-skills · 80 tokens

digital-health-clinical-asr-finetune

Stage 4 of the Clinical ASR Flywheel. Use when priority KER is above 0.3 to run stock NeMo SFT on Parakeet TDT v2 and offline cycle N+1 re-eval. NOT for generic word boosting (use /finetune-asr).

NVIDIA/skills · 72 tokens