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

Ml Pipeline

  • 18 installs
  • 869 repo stars
  • Updated June 8, 2026
  • beita6969/scienceclaw

ml-pipeline is a Claude skill for building end-to-end machine learning pipelines for scientific research with scikit-learn.

About

This skill provides an end-to-end machine-learning pipeline for scientific research using scikit-learn. It covers preprocessing, cross-validation, hyperparameter tuning, evaluation, feature importance with SHAP, and unsupervised methods like PCA and clustering. Developers use it to build predictive or clustering models on research data.

  • End-to-end ML pipeline for scientific research
  • Covers preprocessing, feature engineering, model selection, training, and interpretation
  • Includes model-selection guide, SHAP explainability, and unsupervised learning

Ml Pipeline by the numbers

  • 18 all-time installs (skills.sh)
  • Ranked #1,276 of 2,065 Data Science & ML skills by installs in the Skillselion catalog
  • Data as of Aug 2, 2026 (Skillselion catalog sync)
At a glance

ml-pipeline capabilities & compatibility

Free; requires Python with scikit-learn and related libraries.

Capabilities
math computation · meta analysis · matplotlib viz
Use cases
data analysis · research
Pricing
Free
From the docs

What ml-pipeline says it does

Machine learning pipeline for scientific research including data preprocessing, feature engineering, model selection, training, evaluation, and interpretation.
SKILL.md
Data → Clean → Features → Split → Train → Evaluate → Interpret → Report
SKILL.md
SHAP values (model-agnostic)
SKILL.md
npx skills add https://github.com/beita6969/scienceclaw --skill ml-pipeline

Add your badge

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

Listed on Skillselion
Installs18
repo stars869
Last updatedJune 8, 2026
Repositorybeita6969/scienceclaw

What it does

Build predictive or clustering models on research data with preprocessing, cross-validation, tuning, and SHAP interpretation.

Who is it for?

Building predictive models, classification, clustering, feature selection, and cross-validation on research data.

When should I use this skill?

A user asks to build a predictive model, classify data, cluster samples, or apply ML to research data.

What you get

Delivers a trained, cross-validated, interpreted model with reportable metrics.

  • Trained ML model
  • Cross-validation metrics
  • Feature importance / SHAP plots

By the numbers

  • 9-model selection guide
  • 10-item paper-reporting checklist

Files

SKILL.mdMarkdownGitHub ↗

ML Pipeline

Machine learning for scientific research. Venv: source /Users/zhangmingda/clawd/.venv/bin/activate

Pipeline Overview

Data → Clean → Features → Split → Train → Evaluate → Interpret → Report

Model Selection Guide

TaskData SizeInterpretability NeedRecommended
Classification (small)< 10KHighLogistic Regression, Decision Tree
Classification (medium)10K-100KMediumRandom Forest, XGBoost
Classification (large)> 100KLow OKNeural Network, XGBoost
Regression (linear)AnyHighLinear/Ridge/Lasso
Regression (nonlinear)Medium+MediumRandom Forest, Gradient Boosting
ClusteringAnyMediumK-Means, DBSCAN, Hierarchical
Dimensionality reductionAnyMediumPCA, t-SNE, UMAP
Anomaly detectionAnyMediumIsolation Forest, LOF
Time seriesAnyVariesARIMA, Prophet, LSTM

Standard Pipeline

import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split, cross_val_score, GridSearchCV
from sklearn.preprocessing import StandardScaler, LabelEncoder
from sklearn.metrics import classification_report, confusion_matrix, roc_auc_score
from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import Pipeline

# 1. Preprocessing
X = df.drop('target', axis=1)
y = df['target']
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42, stratify=y)

# 2. Pipeline with scaling
pipe = Pipeline([
    ('scaler', StandardScaler()),
    ('model', RandomForestClassifier(random_state=42))
])

# 3. Cross-validation
scores = cross_val_score(pipe, X_train, y_train, cv=5, scoring='roc_auc')
print(f"CV AUC: {scores.mean():.3f} ± {scores.std():.3f}")

# 4. Hyperparameter tuning
param_grid = {
    'model__n_estimators': [100, 300, 500],
    'model__max_depth': [5, 10, None],
    'model__min_samples_leaf': [1, 5, 10]
}
grid = GridSearchCV(pipe, param_grid, cv=5, scoring='roc_auc', n_jobs=-1)
grid.fit(X_train, y_train)

# 5. Evaluation
y_pred = grid.predict(X_test)
print(classification_report(y_test, y_pred))
print(f"Test AUC: {roc_auc_score(y_test, grid.predict_proba(X_test)[:,1]):.3f}")

Feature Importance & Explainability

# Built-in importance (tree models)
importances = grid.best_estimator_.named_steps['model'].feature_importances_
feat_imp = pd.Series(importances, index=X.columns).sort_values(ascending=False)

# SHAP values (model-agnostic)
# pip install shap
import shap
explainer = shap.TreeExplainer(model)
shap_values = explainer.shap_values(X_test)
shap.summary_plot(shap_values, X_test)

Unsupervised Learning

from sklearn.cluster import KMeans, DBSCAN
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE

# PCA
pca = PCA(n_components=0.95)  # retain 95% variance
X_pca = pca.fit_transform(X_scaled)
print(f"Components: {pca.n_components_}, Explained variance: {pca.explained_variance_ratio_.cumsum()[-1]:.3f}")

# K-Means with elbow method
inertias = [KMeans(n_clusters=k, random_state=42).fit(X_scaled).inertia_ for k in range(2, 11)]

# t-SNE visualization
X_tsne = TSNE(n_components=2, random_state=42, perplexity=30).fit_transform(X_scaled)

Reporting ML Results in Papers

Always include: 1. Dataset description (size, features, class balance) 2. Preprocessing steps 3. Model selection rationale 4. Cross-validation strategy (k-fold, stratified, leave-one-out) 5. Hyperparameter search space and method 6. Multiple metrics (accuracy, precision, recall, F1, AUC) 7. Comparison with baselines 8. Feature importance / model interpretation 9. Confidence intervals or statistical tests on performance 10. Code/data availability statement

Tips

  • Always use stratified splits for imbalanced data
  • Report multiple metrics, not just accuracy
  • Compare against simple baselines (majority class, mean prediction)
  • Use nested CV for unbiased performance estimation
  • Check for data leakage (especially with time series)
  • Document random seeds for reproducibility

Related skills

FAQ

What does the pipeline cover?

Data cleaning, feature engineering, train/test split, training, evaluation, interpretation, and reporting.

Does it support explainability?

Yes, it uses tree feature importances and SHAP values for model interpretation.

Data Science & MLllmresearchautomation

This week in AI coding

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

unsubscribe anytime.