# Scikit Learn

Machine learning in Python with scikit-learn.

- Repository: https://github.com/zLanqing/codex-claude-academic-skills (5550 stars)
- Category: Data and ML
- License: BSD-3-Clause license
- Last updated: 2026-05-14
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add zLanqing/codex-claude-academic-skills --skill scikit-learn -g -a claude-code -y`
Codex: `npx skills add zLanqing/codex-claude-academic-skills --skill scikit-learn -g -a codex -y`
Cursor: `npx skills add zLanqing/codex-claude-academic-skills --skill scikit-learn -g -a cursor -y`
Gemini CLI: `npx skills add zLanqing/codex-claude-academic-skills --skill scikit-learn -g -a gemini-cli -y`

## Description

Machine learning in Python with scikit-learn. Use when working with supervised learning (classification, regression), unsupervised learning (clustering, dimensionality reduction), model evaluation, hyperparameter tuning, preprocessing, or building ML pipelines. Provides comprehensive reference documentation for algorithms, preprocessing techniques, pipelines, and best practices.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Scikit-learn

## Overview

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.

## Installation

```bash
# Install scikit-learn using uv
uv pip install scikit-learn

# Optional: Install visualization dependencies
uv pip install matplotlib seaborn

# Commonly used with
uv pip install pandas numpy
```

## When to Use This Skill

Use the scikit-learn skill when:

- Building classification or regression models
- Performing clustering or dimensionality reduction
- Preprocessing and transforming data for machine learning
- Evaluating model performance with cross-validation
- Tuning hyperparameters with grid or random search
- Creating ML pipelines for production workflows
- Comparing different algorithms for a task
- Working with both structured (tabular) and text data
- Need interpretable, classical machine learning approaches

## 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

The rest: https://github.com/zLanqing/codex-claude-academic-skills/blob/HEAD/scientific-toolkit-skill/references/scientific-skills/scikit-learn/SKILL.md
