Provides guidance on classical machine learning with scikit-learn: algorithms, preprocessing, pipelines, model evaluation, and hyperparameter tuning for classification, regression, clustering, and dimensionality reduction.
Ships in alterlab-data-science. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This skill provides comprehensive guidance for machine learning tasks using scikit-learn, the industry-standard Python library for classical machine learning. Use this skill for classification, regression, clustering, dimensionality reduction, preprocessing, model evaluation, and building production-ready ML pipelines.
# No install step: uv resolves the packages per call (scikit-learn >= 1.8 needs Python >= 3.11)
uv run --python ">=3.12" --with "scikit-learn>=1.8" --with pandas python pipeline.py
# Optional plotting dependencies
uv run --python ">=3.12" --with "scikit-learn>=1.8" --with pandas --with matplotlib --with seaborn python pipeline.py
Use the scikit-learn skill when:
| Scenario | Use Instead |
|---|---|
| Bayesian models with posteriors, credible intervals, or MCMC diagnostics | alterlab-pymc |
| Censored time-to-event outcomes (Cox models, survival forests, C-index) | alterlab-scikit-survival |
UMAP embeddings with n_neighbors / min_dist tuning | alterlab-umap |
| Explaining a fitted model's predictions with SHAP values and plots | alterlab-shap |
| Coefficient tables, p-values, and residual diagnostics for inference | alterlab-statsmodels |
Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-pymc) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.
Minimal classification flow: stratified train_test_split → StandardScaler (fit on train only) → fit estimator → classification_report. For mixed numeric/categorical data, wrap preprocessing in a ColumnTransformer inside a Pipeline so it cross-validates without leakage.
See references/worked_examples.md for full copy-paste classification and mixed-data pipeline examples.
Comprehensive algorithms for classification and regression tasks.
Key algorithms:
When to use:
See: references/supervised_learning.md for detailed algorithm documentation, parameters, and usage examples.
Discover patterns in unlabeled data through clustering and dimensionality reduction.
Clustering algorithms:
Dimensionality reduction:
When to use:
See: references/unsupervised_learning.md for detailed documentation.
Tools for robust model evaluation, cross-validation, and hyperparameter tuning.
Cross-validation strategies:
Hyperparameter tuning:
Metrics:
When to use:
See: references/model_evaluation.md for comprehensive metrics and tuning strategies.
Transform raw data into formats suitable for machine learning.
Scaling and normalization:
Encoding categorical variables:
y, not features)Handling missing values:
Feature engineering:
When to use:
See: references/preprocessing.md for detailed preprocessing techniques.
Build reproducible, production-ready ML workflows.
Key components:
Benefits:
When to use:
See: references/pipelines_and_composition.md for comprehensive pipeline patterns.
Two runnable end-to-end scripts ship with this skill:
python scripts/classification_pipeline.py # mixed-data preprocessing, model comparison, GridSearchCV, evaluation, feature importance
python scripts/clustering_analysis.py # optimal-k search, K-Means/DBSCAN/Agglomerative/GMM comparison, PCA visualization
See references/worked_examples.md for what each script demonstrates and standalone copy-paste versions.
This skill includes comprehensive reference files for deep dives into specific topics:
File: references/quick_reference.md
File: references/supervised_learning.md
File: references/unsupervised_learning.md
File: references/model_evaluation.md
File: references/preprocessing.md
File: references/pipelines_and_composition.md
File: references/worked_examples.md
File: references/best_practices_and_troubleshooting.md
train_test_split → ColumnTransformer preprocessing inside a Pipeline → GridSearchCV tuning → classification_report on the held-out test set.StandardScaler → silhouette sweep over k to pick optimal_k → fit KMeans → PCA(n_components=2) projection for visualization.See references/worked_examples.md for the numbered, copy-paste version of each workflow.
LogisticRegression(penalty=...) is deprecated (removed in 1.10): use l1_ratio (0 = L2, 1 = L1, in between = elastic net) and C=np.inf for no penalty.SVC(probability=True) is deprecated (removed in 1.11): wrap the model as CalibratedClassifierCV(SVC(), ensemble=False) when probabilities are needed.MDS(metric=True/False) became metric_mds=; HDBSCAN warns unless copy is set explicitly.mean_squared_error(..., squared=False) is gone; use root_mean_squared_error.Pipeline (prevents leakage); fit on train only, transform test.stratify=y for classification splits; set random_state everywhere for reproducibility.See references/best_practices_and_troubleshooting.md for code examples and fixes for ConvergenceWarning, overfitting, and large-dataset memory errors.
evals/evals.json (opens in a new tab)references/best_practices_and_troubleshooting.md (opens in a new tab)references/model_evaluation.md (opens in a new tab)references/pipelines_and_composition.md (opens in a new tab)references/preprocessing.md (opens in a new tab)references/quick_reference.md (opens in a new tab)references/supervised_learning.md (opens in a new tab)references/unsupervised_learning.md (opens in a new tab)references/worked_examples.md (opens in a new tab)scripts/classification_pipeline.py (opens in a new tab)scripts/clustering_analysis.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
22 skills in this plugin
/alterlab-daskScales pandas/NumPy workflows beyond memory with Dask distributed computing — parallel DataFrames, arrays, delayed task graphs, and cluster execution. Use when existing pandas/NumPy code must run on larger-than-RAM data or across clusters, for parallel file processing, distributed ML, or integration with existing pandas code. For out-of-core analytics on a single machine prefer vaex; for in-memory speed prefer polars. Part of the AlterLab Academic Skills suite./alterlab-edaExploratory data analysis (EDA) on a scientific data file — auto-detects the format, runs structure/quality/statistics checks, and writes a markdown EDA report with downstream recommendations. Use when asked to "explore", "analyze", "summarize", "profile", or "QC" a data file, or to understand its structure/content/quality before deciding what analysis to run. Covers tabular (.csv .tsv .xlsx .parquet), arrays (.npy .npz .hdf5 .h5 .mat .fits), sequence/genomics (.fasta .fastq .sam .bam .vcf .bed .gff .gtf .h5ad), microscopy (.tif .nd2 .czi .lif .ims .dcm .nii), spectroscopy/MS (.mzML .mzXML .mgf .fid .jdx), chemistry (.pdb .cif .mol .sdf .xyz .gro), and proteomics/metabolomics (.pepXML .mzid .mzTab). For zero-shot forecasting of a series use alterlab-timesfm; to create/configure a chunked cloud array store use alterlab-zarr. Part of the AlterLab Academic Skills suite./alterlab-networkxCreates, analyzes, and visualizes complex networks and graphs in Python with NetworkX. Use when working with network/graph data structures, analyzing relationships between entities, computing graph algorithms (shortest paths, centrality, clustering), detecting communities, generating synthetic networks, or visualizing topologies — applicable to social, biological, transportation, citation, and any pairwise-relationship networks. This is classical graph analytics, not deep learning — for training graph neural networks (GCN/message passing, node/edge/graph classification on Cora-style data) use alterlab-torch-geometric instead. Part of the AlterLab Academic Skills suite./alterlab-polarsFast in-memory DataFrame analytics with Polars — lazy evaluation, parallel execution, and an Apache Arrow backend for datasets that fit in RAM. Use when pandas is too slow but data still fits in memory, for 1-100GB datasets, ETL pipelines, or a faster pandas replacement. For larger-than-RAM data prefer dask or vaex. Part of the AlterLab Academic Skills suite./alterlab-pufferlibScales reinforcement learning with PufferLib — high-throughput parallel training (PuffeRL), vectorized environments, and native multi-agent systems achieving 2-10x speedups over standard implementations. Use when scaling RL to millions of steps per second, running vectorized or multi-agent setups, building custom PufferEnv tasks, or integrating game environments (Atari, Procgen, NetHack, PettingZoo). For standard single-agent algorithm implementations (PPO/SAC/DQN) or quick prototyping prefer alterlab-stable-baselines3. Part of the AlterLab Academic Skills suite./alterlab-pymcBayesian modeling and probabilistic programming with PyMC 6 and ArviZ 1.x — hierarchical models, MCMC (NUTS via PyMC, nutpie, NumPyro, or BlackJAX), variational inference, PSIS-LOO model comparison, and prior/posterior predictive checks. Use when fitting Bayesian or hierarchical models, estimating posteriors and credible intervals, diagnosing divergences, R-hat, or ESS, running probabilistic inference, or comparing models with LOO (WAIC was removed from ArviZ 1.x). Part of the AlterLab Academic Skills suite./alterlab-data-science:alterlab-scikit-learnfrom alterlab-data-science
npx claudepluginhub alterlab-ieu/alterlab-academic-skills --plugin alterlab-data-science2 plugins in one repository ship this exact skill · first indexed Nov 9, 2026
Other plugins' skills for the same job