ml-model-trainer
Skill1 starsChanged 5 months agoApache-2.0View on GitHub
Trains a traditional ML model (classification, regression, clustering) using scikit-learn or PyTorch. Use when building predictive models on tabular or structured data.
In this repository58 other files it gives its agents.
- agent-chain-designerSkill
- api-wrapper-builderSkill
- embeddings-builderSkill
- evaluation-harnessSkill
- fine-tuning-preparerSkill
- llm-router-builderSkill
- model-benchmarkerSkill
- prompt-engineerSkill
- rag-pipeline-builderSkill
- synthetic-data-generatorSkill
- vector-db-integratorSkill
- csv-processorSkill
- database-schema-designerSkill
- data-pipeline-builderSkill
- etl-workflow-designerSkill
- json-transformerSkill
- pandas-data-cleanerSkill
- report-generatorSkill
- sql-query-optimizerSkill
- time-series-analyzerSkill
- visualization-generatorSkill
- backup-strategySkill
- ci-cd-optimizerSkill
- docker-compose-generatorSkill
- github-actions-pipelineSkill
- kubernetes-deploymentSkill
- load-balancer-configSkill
- log-aggregator-setupSkill
- monitoring-dashboardSkill
- nginx-config-generatorSkill
- security-hardeningSkill
- ssl-certificate-managerSkill
- terraform-module-builderSkill
- api-security-auditorSkill
- compliance-checkerSkill
- dependency-checkerSkill
- incident-responderSkill
- jwt-security-auditorSkill
- owasp-checkerSkill
- penetration-test-plannerSkill
- secret-detectorSkill
- threat-model-designerSkill
- vulnerability-scannerSkill
- accessibility-auditorSkill
- api-route-builderSkill
- auth-flow-builderSkill
- css-animation-crafterSkill
- form-validatorSkill
- graphql-schema-designerSkill
- html-component-builderSkill
- nextjs-app-scaffoldSkill
- performance-auditorSkill
- pwa-setupSkill
- react-component-generatorSkill
- responsive-layout-systemSkill
- seo-optimizerSkill
- tailwind-design-systemSkill
- websocket-integrationSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 41
Create interactions, polynomial features, date/time features, aggregations.
- Very specific: line 62
Use sklearn.pipeline.Pipeline + ColumnTransformer so preprocessing is fitted only on train and applied consistently.
- Very specific: line 84
Class imbalance: Use class_weight, SMOTE (carefully), or appropriate metrics (not accuracy).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Overview
Trains, evaluates, and serializes traditional machine learning models for tabular/structured data. Covers problem type identification, feature engineering checklist, model selection with tradeoffs, hyperparameter tuning (GridSearch, Optuna), cross-validation, evaluation metrics by problem type, full scikit-learn Pipeline, model serialization (joblib / pickle / ONNX), and a complete end-to-end training script template.
When to Use This Skill
- Building a predictive model on tabular data (CSV, database, features from other systems).
- The user has "a dataset with labels" or "predict X from these features".
- You need something interpretable and fast to train/infer (as opposed to deep learning or LLMs).
Prerequisites
- Cleaned tabular dataset (pandas DataFrame) with target variable.
- Python with
scikit-learn,pandas,numpy,joblib. Optionallyoptuna,xgboost,lightgbm,catboost,pytorch. - Understanding of the business problem (what "good" looks like).
Steps
- Problem framing:
- Classification (binary, multiclass, multilabel)?
- Regression (continuous target)?
- Clustering (no labels, find groups)?
- Time-series specific considerations?
- Feature engineering checklist:
- Handle missing values (imputer in pipeline).
- Encode categoricals (OneHot, Target, Ordinal — choose per cardinality).
- Scale numeric features (StandardScaler, RobustScaler).
- Create interactions, polynomial features, date/time features, aggregations.
- Feature selection (mutual info, permutation importance, or model-based).
- Model selection (with tradeoffs):
- Baseline: Dummy / Linear / Logistic.
- Tree-based: RandomForest, XGBoost, LightGBM, CatBoost (often win on tabular).
- Linear models for interpretability / speed.
- Neural nets (MLP or more advanced) only when data volume justifies.
- Cross-validation & tuning:
- StratifiedKFold for classification.
- TimeSeriesSplit for time-ordered data.
- GridSearchCV or (better) Optuna for hyperparameter search.
- Nested CV when you need unbiased performance estimate.
- Evaluation (choose the right metrics):
- Classification: Accuracy, Precision/Recall/F1 (per class + macro), ROC-AUC, PR-AUC, confusion matrix, calibration.
- Regression: MAE, RMSE, R², MAPE (be careful with zeros).
- Clustering: Silhouette, Davies-Bouldin, or downstream task performance.
- Full Pipeline:
- Use
sklearn.pipeline.Pipeline+ColumnTransformerso preprocessing is fitted only on train and applied consistently. - Include the final estimator.
- Use
- Serialization & serving:
joblib.dump(pipeline, 'model.joblib').- ONNX for cross-platform / faster inference.
- Simple FastAPI or Flask wrapper for real-time serving.
- Batch scoring script.
- Output:
- Complete
train.pythat loads data → builds pipeline → tunes → evaluates → saves model + metrics. - Feature importance plot (for tree models).
- Evaluation report (Markdown or notebook).
- Inference example code.
- Notes on monitoring (data drift, prediction drift).
- Complete
Examples
A full end-to-end script for a customer churn classification problem (tabular features): preprocessing with ColumnTransformer, LightGBM + Optuna tuning, cross-validation, SHAP importance, model save, and a simple prediction function is included. Similar template for regression and clustering.
Edge Cases & Error Handling
- Class imbalance: Use
class_weight, SMOTE (carefully), or appropriate metrics (not accuracy). - Data leakage: Pipeline ensures no leakage; be extra careful with time-based features.
- Categorical with high cardinality: Target encoding with smoothing or embeddings.
Verification
- The training script runs end-to-end and produces a saved model.
- Cross-validation scores are reasonable and stable.
- On a held-out test set, performance matches or exceeds the CV estimate.
- The pipeline can be loaded in a fresh environment and used to predict on new data with identical preprocessing.
- Feature importance or SHAP values make business sense.
- Success: You have a validated, serialized model that can be deployed and monitored.
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

