Provides guidance on classical machine learning with scikit-learn: algorithms, preprocessing, pipelines, model evaluation, and hyperparameter tuning for classification, regression, clustering, and dimensionality reduction.
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
Not loaded · from alterlab-writing-tools
Claude Code won't load this skill
It ships in alterlab-writing-tools at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
Generated from the plugin's indexed repository (alterlab-ieu/alterlab-academic-skills) — no native marketplace selected
npx claudepluginhub p/alterlab-ieu-alterlab-writing-tools241 skills in this plugin
/alterlab-abm-mesaBuilds agent-based models of social systems with Mesa 3 — the current AgentSet API (model.agents.shuffle_do('step'), auto-assigned unique_id, mandatory super().__init__(rng=...)), cell spaces (mesa.discrete_space OrthogonalMooreGrid / classic mesa.space grids), the DataCollector, batch_run parameter sweeps, and SolaraViz — for emergence, segregation, diffusion, opinion dynamics, and cooperation models. It uses the Mesa 3.x API (the old mesa.time schedulers like RandomActivation are removed) and treats the model as a generative theory to be validated, not just run. Use when the request mentions an agent-based model, Mesa, simulating interacting agents, or emergent macro behavior from micro rules. For discrete-event (queueing/process) simulation prefer alterlab-simpy; for reinforcement learning prefer alterlab-stable-baselines3. Part of the AlterLab Academic Skills suite./alterlab-academic-careerPrepares academic career documents and professional-development materials for faculty and researchers. Use when drafting academic CVs, research statements, teaching philosophies, diversity statements, faculty-position cover letters, tenure dossiers, promotion narratives, academic portfolios, or mentorship statements, and when planning conference-networking strategy, building academic web presence, setting up ORCID profiles, or understanding impact metrics. Part of the AlterLab Academic Skills suite.2 plugins in one repository ship this exact skill · first indexed Nov 9, 2026
Other plugins' skills for the same job