Agent skill · research science · secondsky

ml-model-training

Train ML models with scikit-learn, PyTorch, TensorFlow. Use for classification/regression, neural networks, hyperparameter tuning, or encountering overfitting, underfitting, convergence issues.

Why this skill is useful

Provides specific code examples and workflows for training ML models using scikit-learn, PyTorch, and TensorFlow, which the AI may not generate accurately on its own.

What it needs

Requires pandas, scikit-learn, torch installed locally. About 3k tokens when loaded. Last updated 2026-08-06. 204 stars on the source repository.

What this skill does

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 Scikit-learn Training PyTorch Training Evaluation Metrics Task Metrics ------ --------- Classification Accuracy, Precision, Recall, F1, AUC-ROC Regression MSE, 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: 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: 3. Overfitting Due to No Regularization Problem: Complex models memorize training data, perform poorly on validation/test sets. Solution: Add regularization techniques: 4. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills secondsky/ml-model-training

View the source on GitHub

Browse the @skills marketplace