Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
itallstartedwithaidea avatar

Machine Learning

  • 60 installs
  • 31 repo stars
  • Updated April 12, 2026
  • itallstartedwithaidea/agent-skills

machine-learning is an agent skill that constructs reproducible PyTorch and scikit-learn pipelines with tuning, tracking, and interpretability.

About

machine-learning is an agent skill from the Agent Skills collection aimed at builders who have working notebooks but need production-minded ML discipline. It directs agents to construct full pipelines: model selection, training, evaluation, hyperparameter tuning, and experiment tracking using PyTorch and scikit-learn. The skill stresses software engineering habits—version-controlled experiments, deterministic training, and interpretable outputs—so you can reproduce results months later. Interpretability is mandatory: SHAP, feature importance, and partial dependence explain what the model learned. Solo founders shipping prediction features, ranking, or classification into a SaaS backend benefit most when they lack a dedicated ML platform team. Use it during build when implementing models, and again in ship when you need rigorous validation evidence before release.

  • End-to-end ML pipelines with PyTorch and scikit-learn
  • Train/validation/test splits, stratified cross-validation, and learning curves
  • Hyperparameter optimization with experiment configuration tracking
  • SHAP values, feature importance, and partial dependence for interpretability
  • Reproducible workflows: versioned experiments, deterministic training, stored artifacts

Machine Learning by the numbers

  • 60 all-time installs (skills.sh)
  • +6 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #897 of 2,064 Data Science & ML skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/itallstartedwithaidea/agent-skills --skill machine-learning

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs60
repo stars31
Security audit3 / 3 scanners passed
Last updatedApril 12, 2026
Repositoryitallstartedwithaidea/agent-skills

What it does

Turn notebook experiments into reproducible PyTorch and scikit-learn pipelines with splits, tuning, tracking, and interpretability.

Who is it for?

Best when you're adding ML features to a product and want scikit-learn or PyTorch pipelines with experiment logs and SHAP-style explanations.

Skip if: Pure LLM prompt tuning with no classical ML training, or teams that only need a one-off Kaggle notebook with no reproducibility requirements.

When should I use this skill?

When you need end-to-end ML pipeline construction with model selection, training, evaluation, interpretability, hyperparameter tuning, and experiment tracking.

What you get

You get a documented ML workflow with proper validation, hyperparameter search, tracked metrics and artifacts, and interpretability reports suitable for iteration or release review.

  • Training and evaluation pipeline with documented splits
  • Experiment log with configs, metrics, and artifacts
  • Interpretability outputs (SHAP, importance, partial dependence)

Files

SKILL.mdMarkdownGitHub ↗

Machine Learning

Part of Agent Skills™ by googleadsagent.ai™

Description

Machine Learning provides end-to-end ML pipeline construction with PyTorch and scikit-learn, covering model selection, training, evaluation, interpretability, hyperparameter tuning, and experiment tracking. The agent builds reproducible ML workflows that follow software engineering best practices: version-controlled experiments, deterministic training, and interpretable results.

The gap between a working notebook and a production ML pipeline is enormous. This skill bridges that gap by enforcing structured experiment management, proper train/validation/test splits, stratified cross-validation, learning curve analysis, and systematic hyperparameter optimization. The agent tracks every experiment with its configuration, metrics, and artifacts, making it possible to reproduce any result months later.

Model interpretability is treated as a first-class requirement, not an optional post-hoc analysis. Every model comes with SHAP values, feature importance rankings, and partial dependence plots that explain what the model learned and why it makes specific predictions. Black-box predictions without explanations are insufficient for scientific and business-critical applications.

Use When

  • Building classification or regression models
  • Tuning hyperparameters systematically
  • Explaining model predictions with SHAP or feature importance
  • Setting up experiment tracking for ML projects
  • Evaluating model performance with proper cross-validation
  • Training PyTorch models with structured training loops

How It Works

graph TD
    A[Dataset] --> B[Train/Val/Test Split]
    B --> C[Feature Engineering]
    C --> D[Model Selection]
    D --> E[Hyperparameter Tuning: Optuna]
    E --> F[Cross-Validation]
    F --> G[Best Model Training]
    G --> H[Evaluation on Test Set]
    H --> I[Interpretability: SHAP]
    I --> J[Experiment Logging]
    J --> K[Model Registry]

The pipeline enforces a strict separation between tuning (using validation data) and final evaluation (using held-out test data). The test set is touched exactly once, preventing information leakage from repeated evaluation.

Implementation

import torch
import torch.nn as nn
from torch.utils.data import DataLoader, TensorDataset
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import classification_report, roc_auc_score
import optuna
import shap
import numpy as np

class Classifier(nn.Module):
    def __init__(self, input_dim: int, hidden_dim: int, dropout: float):
        super().__init__()
        self.net = nn.Sequential(
            nn.Linear(input_dim, hidden_dim),
            nn.ReLU(),
            nn.Dropout(dropout),
            nn.Linear(hidden_dim, hidden_dim // 2),
            nn.ReLU(),
            nn.Dropout(dropout),
            nn.Linear(hidden_dim // 2, 1),
        )

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return self.net(x)

def train_epoch(model, loader, optimizer, criterion, device):
    model.train()
    total_loss = 0
    for X_batch, y_batch in loader:
        X_batch, y_batch = X_batch.to(device), y_batch.to(device)
        optimizer.zero_grad()
        pred = model(X_batch).squeeze()
        loss = criterion(pred, y_batch.float())
        loss.backward()
        optimizer.step()
        total_loss += loss.item() * len(X_batch)
    return total_loss / len(loader.dataset)

def hyperparameter_search(X: np.ndarray, y: np.ndarray, n_trials: int = 50) -> dict:
    def objective(trial):
        hidden = trial.suggest_int("hidden_dim", 32, 256)
        lr = trial.suggest_float("lr", 1e-4, 1e-2, log=True)
        dropout = trial.suggest_float("dropout", 0.1, 0.5)

        skf = StratifiedKFold(n_splits=5, shuffle=True, random_state=42)
        scores = []
        for train_idx, val_idx in skf.split(X, y):
            model = Classifier(X.shape[1], hidden, dropout)
            optimizer = torch.optim.Adam(model.parameters(), lr=lr)
            criterion = nn.BCEWithLogitsLoss()

            train_ds = TensorDataset(torch.tensor(X[train_idx], dtype=torch.float32),
                                     torch.tensor(y[train_idx], dtype=torch.float32))
            loader = DataLoader(train_ds, batch_size=64, shuffle=True)

            for _ in range(20):
                train_epoch(model, loader, optimizer, criterion, "cpu")

            model.eval()
            with torch.no_grad():
                val_pred = model(torch.tensor(X[val_idx], dtype=torch.float32)).squeeze()
            scores.append(roc_auc_score(y[val_idx], val_pred.numpy()))

        return np.mean(scores)

    study = optuna.create_study(direction="maximize")
    study.optimize(objective, n_trials=n_trials)
    return study.best_params

def explain_model(model, X_sample: np.ndarray, feature_names: list[str]):
    model.eval()
    explainer = shap.DeepExplainer(model, torch.tensor(X_sample[:100], dtype=torch.float32))
    shap_values = explainer.shap_values(torch.tensor(X_sample, dtype=torch.float32))
    shap.summary_plot(shap_values, X_sample, feature_names=feature_names, show=False)

Best Practices

  • Set random seeds for numpy, torch, and Python's random module for reproducibility
  • Use stratified splits for classification to preserve class distribution
  • Touch the test set exactly once—never tune hyperparameters on test data
  • Report confidence intervals from cross-validation, not single-run metrics
  • Include SHAP or permutation importance for every model beyond a baseline
  • Log all experiment parameters, metrics, and artifacts for reproducibility

Platform Compatibility

PlatformSupportNotes
CursorFullPython + PyTorch + Jupyter
VS CodeFullML extension ecosystem
WindsurfFullML workflow support
Claude CodeFullTraining script generation
ClineFullML pipeline construction
aiderPartialCode generation only

Related Skills

  • Data Analysis
  • Bioinformatics
  • Research Methodology
  • Workflow Orchestration

Keywords

machine-learning pytorch scikit-learn hyperparameter-tuning optuna shap interpretability experiment-tracking cross-validation

---

© 2026 googleadsagent.ai™ | Agent Skills™ | MIT License

Related skills

How it compares

Use for disciplined training pipelines instead of ad-hoc notebook cells without splits, tracking, or interpretability gates.

FAQ

Who is machine-learning for?

Developers and small teams building predictive or classification features who use PyTorch or scikit-learn and need reproducible, explainable training workflows.

When should I use machine-learning?

In validate when scoping feasibility with proper evaluation design; in build when implementing training code; in ship when you need cross-validation and learning-curve evidence before launch.

Is machine-learning safe to install?

Check the Security Audits panel on this Prism page; ML skills often need shell and network for package installs and should not run untrusted training data without review.

Data Science & MLanalyticspipelines

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.