machine-learning

Build reproducible PyTorch and scikit-learn pipelines with stratified cross-validation and Optuna tuning.

31|8|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/itallstartedwithaidea/agent-skills --skill machine-learning-itallstartedwithaidea
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: machine-learning
Source: https://github.com/itallstartedwithaidea/agent-skills/tree/main/skills/scientific-research/machine-learning
Command: npx skills add https://github.com/itallstartedwithaidea/agent-skills --skill machine-learning-itallstartedwithaidea

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, scikit-learn, optuna, shap, numpy.

What problem does it solve?

Machine Learning turns ad-hoc notebooks into production-grade training pipelines with rigorous evaluation and trustworthy explanations, reducing the risk of misleading results and irreproducible experiments.

Core Features & Use Cases

  • End-to-end ML pipeline construction: Build model selection, training, evaluation, and hyperparameter tuning workflows using PyTorch and scikit-learn.
  • Leakage-safe experiment design: Enforce strict train/validation/test separation with stratified cross-validation so tuning never contaminates final metrics.
  • Interpretability by default: Generate SHAP-based explanations (plus feature importance/insights) so predictions come with defensible reasoning.
  • Experiment tracking and reproducibility: Log configurations, metrics, and artifacts so results can be recreated later.

Quick Start

Ask the AI to build a reproducible PyTorch + scikit-learn training pipeline that performs stratified cross-validation with Optuna tuning, evaluates once on a held-out test set, and produces SHAP explanations for the final best model.

Frequently Asked Questions about machine-learning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a reproducible machine learning pipeline with PyTorch and scikit-learn?

You build a reproducible machine learning pipeline by enforcing strict train/validation/test separation, applying stratified cross-validation, and logging configurations with metrics to recreate results across PyTorch and scikit-learn workflows.

What is leakage-safe hyperparameter tuning and why is it important?

Leakage-safe hyperparameter tuning prevents test data from contaminating validation metrics during model selection. It enforces strict separation between training, validation, and test sets using stratified cross-validation so final performance metrics remain trustworthy.

How do I generate SHAP explanations for a trained classification model?

You generate SHAP explanations by applying SHAP value calculations to the final best model after training and hyperparameter tuning. This produces feature importance insights that provide defensible reasoning for individual predictions.

Can I use Optuna for hyperparameter search across both PyTorch and scikit-learn workflows?

Yes, you can use Optuna for hyperparameter search across PyTorch and scikit-learn workflows. It performs systematic hyperparameter optimization while maintaining leakage-safe experiment design through stratified cross-validation.

Does this approach support experiment tracking for classification and regression projects?

Yes, this approach supports experiment tracking for classification and regression projects by logging configurations, metrics, and artifacts during training and evaluation. This ensures your machine learning experiments can be fully recreated later.

Why does my hyperparameter tuning produce misleading test metrics?

Hyperparameter tuning produces misleading test metrics when validation data leaks into the training process. Applying leakage-safe experiment design with strict train/validation/test separation and stratified cross-validation prevents this contamination.