# Scikit Learn

> Scikit-learn machine learning library. Use for classical ML.

- Skill: `g1joshi/scikit-learn` (Agent Skill)
- Install (CLI): `npx skillmds@latest add g1joshi/scikit-learn`
- Raw SKILL.md: https://api.skillmd.com/api/skills/g1joshi/scikit-learn/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: G1Joshi (https://skillmd.com/u/g1joshi)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/g1joshi/scikit-learn

---


# Scikit-learn

Scikit-learn is the gold standard for "Classical ML" (Regression, SVM, Random Forest). v1.6 (2025) adds **Array API** support (running on GPUs via PyTorch/CuPy).

## When to Use

- **Tabular Data**: Random Forests / Gradient Boosting.
- **Preprocessing**: `StandardScaler`, `LabelEncoder`.
- **Small Data**: When Deep Learning is overkill.

## Core Concepts

### Estimators

Everything implements `.fit(X, y)` and `.predict(X)`.

### Pipelines

Chaining preprocessing and modeling: `Pipeline([('scaler', StandardScaler()), ('svc', SVC())])`.

### Array API

Passing PyTorch tensors directly to Scikit-learn without converting to NumPy (keeping data on GPU).

## Best Practices (2025)

**Do**:

- **Use Pipelines**: Prevent data leakage during cross-validation.
- **Use `HistGradientBoostingClassifier`**: It is much faster than standard extraction implementation (inspired by LightGBM).

**Don't**:

- **Don't use for Images/Audio**: Use PyTorch/DL for unstructured data.

## References

- [Scikit-learn Documentation](https://scikit-learn.org/)

