# Scikit Learn

> Classical machine learning with scikit-learn. Use when building classification, regression, clustering models, or implementing feature engineering pipelines. Use when this capability is needed.

- Skill: `tomevault-io/scikit-learn-2` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/scikit-learn-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/scikit-learn-2/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/scikit-learn-2

---


# Scikit-learn

Activate this skill when working with classical ML algorithms.

## When to Use

- Building classification or regression models
- Feature engineering and selection
- Implementing ML pipelines with preprocessing
- Cross-validation and hyperparameter tuning
- Clustering and dimensionality reduction

## Patterns

```python
from sklearn.pipeline import Pipeline
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import StandardScaler, OneHotEncoder
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.model_selection import cross_val_score

preprocessor = ColumnTransformer([
    ("num", StandardScaler(), numeric_features),
    ("cat", OneHotEncoder(handle_unknown="ignore"), categorical_features),
])

pipeline = Pipeline([
    ("preprocessor", preprocessor),
    ("classifier", GradientBoostingClassifier(n_estimators=200)),
])

scores = cross_val_score(pipeline, X, y, cv=5, scoring="f1_macro")
```

## Rules

- Always split data before any preprocessing
- Use pipelines to prevent data leakage
- Cross-validate before reporting metrics
- Start simple (LogisticRegression) before complex models
- Document feature engineering decisions

---
> Source: [ihatesea69/kiro-kit](https://github.com/ihatesea69/kiro-kit) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-16 -->

