domains / data / scikit-learn-ml-pipelines / scikit-learn
The K-Dense-AI copy is the most complete and current, but the other copies contain material constraints and steps it lacks. The foryourhealth111-pixel copy adds a critical scope boundary (excluding causal identification) and a specific use case (ordinary regression) that the K-Dense copy omits. The sickn33 copy adds a mandatory pre-execution step to read a detailed guide and specific script execution commands. The zLanqing copy is a truncated version of the K-Dense content. Because the K-Dense copy lacks the causal analysis exclusion and the sickn33 copy lacks the detailed algorithmic reference, crowning one would hide real alternatives and constraints.
| Repository | Path |
|---|---|
| zLanqing/codex-claude-academic-skills | scientific-toolkit-skill/references/scientific-skills/scikit-learn/SKILL.md |
| K-Dense-AI/scientific-agent-skills | skills/scikit-learn/SKILL.md |
| foryourhealth111-pixel/Vibe-Skills | bundled/skills/scikit-learn/SKILL.md |
| sickn33/agentic-awesome-skills | plugins/agentic-awesome-skills-claude/skills/scikit-learn/SKILL.md |
| Role | Repository | Path |
|---|---|---|
| peer | zLanqing/codex-claude-academic-skills | scientific-toolkit-skill/references/scientific-skills/scikit-learn/SKILL.md |
| peer | K-Dense-AI/scientific-agent-skills | skills/scikit-learn/SKILL.md |
| peer | foryourhealth111-pixel/Vibe-Skills | bundled/skills/scikit-learn/SKILL.md |
| peer | sickn33/agentic-awesome-skills | plugins/agentic-awesome-skills-claude/skills/scikit-learn/SKILL.md |
| inferior | brycewang-stanford/Auto-Empirical-Research-Skills | skills/17-DAAF-Contribution-Community-daaf/dot-claude/skills/scikit-learn/SKILL.md |
| inferior | FreedomIntelligence/OpenClaw-Medical-Skills | skills/scikit-learn/SKILL.md |
| adapter | sickn33/agentic-awesome-skills | plugins/agentic-awesome-skills/skills/scikit-learn/SKILL.md |
| adapter | sickn33/agentic-awesome-skills | skills/scikit-learn/SKILL.md |
---
name: scikit-learn
description: Machine learning in Python with scikit-learn. Use for classification, regression, clustering, model evaluation, and ML pipelines.
license: BSD-3-Clause license
metadata:
skill-author: K-Dense Inc.
version: "1.5"
---
# Scikit-learn
## Overview
This skill provides comprehensive guidance for machine learning tasks using scikit-learn. Use this skill for classification, regression, clustering, dimensionality reduction, preprocessing, model evaluation, and building production-ready ML pipelines.
## Scope Boundaries
- **Use for:** Ordinary regression analysis (fitting, coefficients, confidence intervals, residual checks) where the need is not causal identification.
- **Do NOT use for:** Causal identification, policy-effect claims, DiD, synthetic control, or interrupted time-series effect estimation. Use `performing-causal-analysis` for those tasks.
## Installation
Targets **scikit-learn 1.9.1**, verified with Python 3.13. The release requires Python 3.11+.
```bash
# Install scikit-learn using uv
uv pip install "scikit-learn==1.9.1"
# Optional: plotting utilities and bundled script dependencies
uv pip install "scikit-learn[plots]==1.9.1" matplotlib pandas
```
## Pre-Execution Requirements
Before executing complex workflows, read the relevant reference documentation. For end-to-end work, consult the detailed guide if available in the skill directory.
## Quick Start
### Classification Example
```python
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report
# Split data
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, stratify=y, random_state=42
)
# Preprocess
scaler = StandardScaler()
X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test)
# Train model
model = RandomForestClassifier(n_estimators=100, random_state=42)
model.fit(X_train_scaled, y_train)
# Evaluate
y_pred = model.predict(X_test_scaled)
print(classification_report(y_test, y_pred))
```
### Complete Pipeline with Mixed Data
```python
from sklearn.pipeline import Pipeline
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import StandardScaler, OneHotEncoder
from sklearn.impute import SimpleImputer
from sklearn.ensemble import GradientBoostingClassifier
# Define feature types
numeric_features = ['age', 'income']
categorical_features = ['gender', 'occupation']
# Create preprocessing pipelines
numeric_transformer = Pipeline([
('imputer', SimpleImputer(strategy='median')),
('scaler', StandardScaler())
])
categorical_transformer = Pipeline([
('imputer', SimpleImputer(strategy='most_frequent')),
('onehot', OneHotEncoder(handle_unknown='ignore'))
])
# Combine transformers
preprocessor = ColumnTransformer([
('num', numeric_transformer, numeric_features),
('cat', categorical_transformer, categorical_features)
])
# Full pipeline
model = Pipeline([
('preprocessor', preprocessor),
('classifier', GradientBoostingClassifier(random_state=42))
])
# Fit and predict
model.fit(X_train, y_train)
y_pred = model.predict(X_test)
```
## Core Capabilities
1. **Supervised learning** — classification and regression estimator families.
2. **Unsupervised learning** — clustering, decomposition, and manifold learning.
3. **Model evaluation and selection** — metrics, cross-validation, and hyperparameter search.
4. **Data preprocessing** — scaling, encoding, imputation, and feature selection.
5. **Pipelines and composition** — `Pipeline` and `ColumnTransformer`.
Always fit preprocessing inside a `Pipeline` so it is refit per cross-validation fold; scaling or imputing before splitting leaks test information into training.
## Example Scripts
If bundled scripts are available in the skill directory:
### Classification Pipeline
```bash
python scripts/classification_pipeline.py
```
### Clustering Analysis
```bash
python scripts/clustering_analysis.py
```
## Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.