Agent skill

ML Model Training

by secondsky in secondsky/claude-skills

Train ML models with scikit-learn, PyTorch, TensorFlow. An agent skill from secondsky/claude-skills.

MITAuto-check passedData & Analytics

Install ML Model Training

skills CLI
$ npx skills add secondsky/claude-skills --skill ml-model-training -a claude-code

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

GitHub CLI
$ gh skill install secondsky/claude-skills ml-model-training --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/secondsky/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/ml-model-training/skills/ml-model-training .claude/skills/ml-model-training && 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
ml-model-training
GitHub stars
227
Used in
1 other repo
Token cost
~1.7k tokens
SKILL.md length
332 words
Files
3 (incl. references)
Skills in repo
169
Repo updated
First seen
Licence
MIT

At a glance

Train ML models with scikit-learn, PyTorch, TensorFlow. An agent skill from secondsky/claude-skills.

  • Works in 5 steps: Data Leakage → Class Imbalance Ignored → Overfitting Due to No Regularization → …
  • Classification/regression
  • SKILL.md covers Training Workflow, Data Preparation, Scikit-learn Training and PyTorch Training, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

ML Model Training is an agent skill from secondsky/claude-skills. Train ML models with scikit-learn, PyTorch, TensorFlow. Use for classification/regression, neural networks, hyperparameter tuning, or encountering overfitting, underfitting, convergence issues.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/pytorch-training.md` and `references/tensorflow-keras.md`).

It sits in Data & Analytics, covering Machine learning and Deep learning. It works with PyTorch, TensorFlow and scikit-learn. The repository describes itself as: Production-ready skills for Claude Code CLI - Cloudflare, React, Tailwind v4, and AI integrations. The licence is MIT.

When your agent uses it

  • Classification/regression
  • Neural networks
  • Hyperparameter tuning
  • Encountering overfitting

Example prompts

  • “/ml-model-training”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Data Leakage
  2. Class Imbalance Ignored
  3. Overfitting Due to No Regularization
  4. Not Setting Random Seeds
  5. Using Test Set for Hyperparameter Tuning

What it can do on your machine

Read from SKILL.md and the folder at commit 8837836. 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

ML Model Training loads about 1.7k tokens when it runs, and up to ~4.6k if it reads all its reference files. Until then it costs about 53 tokens; SKILL.md has 332 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.6k

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 secondsky/claude-skills at commit 8837836, republished under its MIT licence (© secondsky). 332 words, ~1,731 tokens.

Download SKILL.mdSave it as .claude/skills/ml-model-training/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
ml-model-training
description
Train ML models with scikit-learn, PyTorch, TensorFlow. Use for classification/regression, neural networks, hyperparameter tuning, or encountering overfitting, underfitting, convergence issues.
license
MIT
metadata.keywords
machine learning, model training, PyTorch, TensorFlow, scikit-learn, neural networks, deep learning, classification, regression, hyperparameter tuning…

ML Model Training

Train machine learning models with proper data handling and evaluation.

Training Workflow

  1. Data Preparation → 2. Feature Engineering → 3. Model Selection → 4. Training → 5. Evaluation

Data Preparation

python
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler, LabelEncoder

# Load and clean data
df = pd.read_csv('data.csv')
df = df.dropna()

# Encode categorical variables
le = LabelEncoder()
df['category'] = le.fit_transform(df['category'])

# Split data (70/15/15)
X = df.drop('target', axis=1)
y = df['target']
X_train, X_temp, y_train, y_temp = train_test_split(X, y, test_size=0.3)
X_val, X_test, y_val, y_test = train_test_split(X_temp, y_temp, test_size=0.5)

# Scale features
scaler = StandardScaler()
X_train = scaler.fit_transform(X_train)
X_val = scaler.transform(X_val)
X_test = scaler.transform(X_test)

Scikit-learn Training

python
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report, accuracy_score

model = RandomForestClassifier(n_estimators=100, random_state=42)
model.fit(X_train, y_train)

y_pred = model.predict(X_val)
print(classification_report(y_val, y_pred))

PyTorch Training

python
import torch
import torch.nn as nn

class Model(nn.Module):
    def __init__(self, input_dim):
        super().__init__()
        self.layers = nn.Sequential(
            nn.Linear(input_dim, 64),
            nn.ReLU(),
            nn.Dropout(0.3),
            nn.Linear(64, 32),
            nn.ReLU(),
            nn.Linear(32, 1),
            nn.Sigmoid()
        )

    def forward(self, x):
        return self.layers(x)

model = Model(X_train.shape[1])
optimizer = torch.optim.Adam(model.parameters(), lr=0.001)
criterion = nn.BCELoss()

for epoch in range(100):
    model.train()
    optimizer.zero_grad()
    output = model(X_train_tensor)
    loss = criterion(output, y_train_tensor)
    loss.backward()
    optimizer.step()

Evaluation Metrics

TaskMetrics
ClassificationAccuracy, Precision, Recall, F1, AUC-ROC
RegressionMSE, RMSE, MAE, R²

Complete Framework Examples

  • PyTorch: See references/pytorch-training.md for complete training with:

    • Custom model classes with BatchNorm and Dropout
    • Training/validation loops with early stopping
    • Learning rate scheduling
    • Model checkpointing
    • Full evaluation with classification report
  • TensorFlow/Keras: See references/tensorflow-keras.md for:

    • Sequential model architecture
    • Callbacks (EarlyStopping, ReduceLROnPlateau, ModelCheckpoint, TensorBoard)
    • Training history visualization
    • TFLite conversion for mobile deployment
    • Custom training loops

Best Practices

Do:

  • Use cross-validation for robust evaluation
  • Track experiments with MLflow
  • Save model checkpoints regularly
  • Monitor for overfitting
  • Document hyperparameters
  • Use 70/15/15 train/val/test split

Don't:

  • Train without a validation set
  • Ignore class imbalance
  • Skip feature scaling
  • Use test set for hyperparameter tuning
  • Forget to set random seeds

Known Issues Prevention

1. Data Leakage

Problem: Scaling or transforming data before splitting leads to test set information leaking into training.

Solution: Always split data first, then fit transformers only on training data:

python
# ✅ Correct: Fit on train, transform train/val/test
scaler = StandardScaler()
X_train = scaler.fit_transform(X_train)
X_val = scaler.transform(X_val)  # Only transform
X_test = scaler.transform(X_test)  # Only transform

# ❌ Wrong: Fitting on all data
X_all = scaler.fit_transform(X)  # Leaks test info!
2. Class Imbalance Ignored

Problem: Training on imbalanced datasets (e.g., 95% class A, 5% class B) leads to models that predict only the majority class.

Solution: Use class weights or resampling:

python
from sklearn.utils.class_weight import compute_class_weight

# Compute class weights
class_weights = compute_class_weight('balanced', classes=np.unique(y_train), y=y_train)
model = RandomForestClassifier(class_weight='balanced')

# Or use SMOTE for oversampling minority class
from imblearn.over_sampling import SMOTE
smote = SMOTE()
X_resampled, y_resampled = smote.fit_resample(X_train, y_train)
3. Overfitting Due to No Regularization

Problem: Complex models memorize training data, perform poorly on validation/test sets.

Solution: Add regularization techniques:

python
# Dropout in PyTorch
nn.Dropout(0.3)

# L2 regularization in scikit-learn
RandomForestClassifier(max_depth=10, min_samples_split=20)

# Early stopping in Keras
from tensorflow.keras.callbacks import EarlyStopping
early_stop = EarlyStopping(monitor='val_loss', patience=10, restore_best_weights=True)
model.fit(X_train, y_train, validation_data=(X_val, y_val), callbacks=[early_stop])
4. Not Setting Random Seeds

Problem: Results are not reproducible across runs, making debugging and comparison impossible.

Solution: Set all random seeds:

python
import random
import numpy as np
import torch

random.seed(42)
np.random.seed(42)
torch.manual_seed(42)
if torch.cuda.is_available():
    torch.cuda.manual_seed_all(42)
5. Using Test Set for Hyperparameter Tuning

Problem: Optimizing hyperparameters on test set leads to overfitting to test data.

Solution: Use validation set for tuning, test set only for final evaluation:

python
from sklearn.model_selection import GridSearchCV

# ✅ Correct: Tune on train+val, evaluate on test
param_grid = {'n_estimators': [50, 100, 200], 'max_depth': [5, 10, 15]}
grid_search = GridSearchCV(RandomForestClassifier(), param_grid, cv=5)
grid_search.fit(X_train, y_train)  # Cross-validation on training set
best_model = grid_search.best_estimator_

# Final evaluation on held-out test set
final_score = best_model.score(X_test, y_test)

When to Load References

Load reference files when you need:

  • PyTorch implementation details: Load references/pytorch-training.md for complete training loops with early stopping, learning rate scheduling, and checkpointing
  • TensorFlow/Keras patterns: Load references/tensorflow-keras.md for callback usage, custom training loops, and mobile deployment with TFLite

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

Files

SKILL.md and 2 other files (references) in plugins/ml-model-training/skills/ml-model-training of secondsky/claude-skills.

  • SKILL.md
  • references/pytorch-training.md
  • references/tensorflow-keras.md

Open the folder on GitHubat commit 8837836

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in secondsky/claude-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

ML Model Training 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.

ML Model Training compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
ML Model Training this skillsecondsky/claude-skills2271 repos~1.7kAutomated safety check: PassMIT
Editomegaml/omegaml107—~206Automated safety check: PassApache-2.0
ML EngineerRightNow-AI/openfang18k—~987Automated safety check: PassApache-2.0
Umap Learnjaechang-hits/SciAgent-Skills370—~4.7kAutomated safety check: PassBSD-3-Clause
Databricks ML Trainingdatabricks/databricks-agent-skills345—~4.6kAutomated safety check: PassCustom licence
Scikit Learn Machine Learningjaechang-hits/SciAgent-Skills3701 repos~4kAutomated safety check: PassBSD-3-Clause

Similar skills

  • Edit

    omegaml/omegaml

    how to use the edit command properly

    107 GitHub stars~206 tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • ML Engineer

    RightNow-AI/openfang

    Machine learning engineer expert for PyTorch, scikit-learn, model evaluation, and MLOps

    18k GitHub stars~987 tokensUpdated 3 mo ago
    Data & AnalyticsAuto-check passed
  • Umap Learn

    jaechang-hits/SciAgent-Skills

    UMAP dimensionality reduction for visualization, clustering prep, and feature engineering.

    370 GitHub stars~4.7k tokensUpdated 8 days ago
    Data & AnalyticsAuto-check passed
  • Databricks ML Training

    databricks/databricks-agent-skills

    Official

    Train ML models on Databricks. An agent skill from databricks/databricks-agent-skills.

    345 GitHub stars~4.6k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Scikit Learn Machine Learning

    jaechang-hits/SciAgent-Skills

    Classical ML in Python: classification, regression, clustering, dim reduction, evaluation, tuning, preprocessing pipelines.

    370 GitHub starsUsed in 1 repo~4k tokens
    Data & AnalyticsAuto-check passed
  • Machine Learning

    ericrisco/rsc-harness

    A skill your agent uses when predicting a column from rows of tabular features with classic models — scikit-learn pipelines, RandomForest, XGBoost/LightGBM, leak-free cross-validation, metrics for…

    156 GitHub stars~4.2k tokensUpdated yesterday
    Data & AnalyticsAuto-check passed

More from secondsky/claude-skills

All 169 skills in this repo
  • Tanstack AI

    secondsky/claude-skills

    TanStack AI (alpha) provider-agnostic type-safe chat with streaming for OpenAI, Anthropic, Gemini, Ollama.

    227 GitHub starsUsed in 1 repo~3.6k tokens
    Auto-check: notes
  • Auto Animate

    secondsky/claude-skills

    AutoAnimate (@formkit/auto-animate) zero-config animations for React.

    227 GitHub stars~2.9k tokensUpdated 9 days ago
    Auto-check passed
  • Base UI React

    secondsky/claude-skills

    MUI Base UI unstyled React components with Floating UI. An agent skill from secondsky/claude-skills.

    227 GitHub stars~1.9k tokensUpdated 9 days ago
    Auto-check passed
  • Cloudflare Images

    secondsky/claude-skills

    This skill should be used when the user asks to "upload images to Cloudflare", "implement direct creator upload", "configure image transformations", "optimize WebP/AVIF", "create image variants"…

    227 GitHub stars~3.6k tokensUpdated 9 days ago
    Auto-check: notes
  • Cloudflare Nextjs

    secondsky/claude-skills

    Deploy Next.js to Cloudflare Workers via the OpenNext adapter (@opennextjs/cloudflare).

    227 GitHub stars~5.3k tokensUpdated 9 days ago
    Auto-check: notes
  • Cloudflare Sandbox

    secondsky/claude-skills

    Cloudflare Sandboxes SDK for secure code execution in Linux containers at edge.

    227 GitHub stars~4.5k tokensUpdated 9 days ago
    Auto-check passed

Questions about ML Model Training

What does ML Model Training do?

Train ML models with scikit-learn, PyTorch, TensorFlow. An agent skill from secondsky/claude-skills. ML Model Training is an agent skill from secondsky/claude-skills. Train ML models with scikit-learn, PyTorch, TensorFlow.

When should I use ML Model Training?

ML Model Training fits situations like: classification/regression; neural networks; hyperparameter tuning; encountering overfitting.

How do I install ML Model Training in Claude Code?

Run `npx skills add secondsky/claude-skills --skill ml-model-training -a claude-code`. Or copy the skill folder (plugins/ml-model-training/skills/ml-model-training in secondsky/claude-skills) into .claude/skills/ml-model-training in your project. Claude Code loads it when a task matches its description.

How do I install ML Model Training in Codex?

Run `npx skills add secondsky/claude-skills --skill ml-model-training -a codex`. Or copy the skill folder (plugins/ml-model-training/skills/ml-model-training in secondsky/claude-skills) into .agents/skills/ml-model-training in your project. Codex loads it when a task matches its description.

Can I use ML Model Training 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 secondsky/claude-skills --skill ml-model-training -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ml-model-training, .gemini/skills/ml-model-training, .github/skills/ml-model-training and .opencode/skills/ml-model-training in your project.

What does ML Model Training need to run?

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

Does ML Model Training 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 ML Model Training 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 ML Model Training use?

ML Model Training 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 ML Model Training use?

About 1.7k tokens (SKILL.md is roughly 6.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.9k tokens, read only when the agent opens those files.

What are the alternatives to ML Model Training?

Skills that share tags, products or a category with ML Model Training: Edit (omegaml/omegaml, 107 stars), ML Engineer (RightNow-AI/openfang, 18k stars), Umap Learn (jaechang-hits/SciAgent-Skills, 370 stars) and Databricks ML Training (databricks/databricks-agent-skills, 345 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains ML Model Training?

secondsky (a GitHub user) maintains it in secondsky/claude-skills, which has 227 GitHub stars. The repository holds 169 skills in this directory. The repository was last updated on September 28, 2026.

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