# scikit-learn — card for AI agents

Python machine learning library with classification, regression and clustering algorithms.

Category: ML and data science · PyPI package `scikit-learn` · latest version 1.9.1 (checked 2026-11-01)
Install: `pip install scikit-learn`
License: BSD-3-Clause (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## scikit-learn
- Target Python 3.12 or newer, NumPy 1.26.0 or newer and SciPy 1.11.4 or newer. Add Matplotlib only if you call `plot_*` functions or `*Display` classes.
- Encode categorical features to numeric values before fitting most estimators. The exception is `HistGradientBoostingClassifier`/`HistGradientBoostingRegressor`, which accept `categorical_features="from_dtype"`.
- For heterogeneous dataframes, put a `ColumnTransformer` first in the pipeline and map columns by name or dtype to dedicated transformers.
- Use the `set_output` API to get dataframes back from transformers. Do not assume estimators compute on the dataframe directly.
- Do not put y transformations in a `Pipeline`. Use `TransformedTargetRegressor` for invertible target transforms.
- Do not build deep models on `sklearn.neural_network`, which only receives bug fixes. The docs point to tensorflow, keras or pytorch for those.
- Set the `SKLEARN_SEED` environment variable to control random number generation when running the test suite.

## Agent Skills for it
- scikit-learn from K-Dense-AI/scientific-agent-skills: `npx skills add K-Dense-AI/scientific-agent-skills --skill scikit-learn`
- scikit-learn from midudev/autoskills: `npx skills add midudev/autoskills --skill scikit-learn`
- scikit-learn from zLanqing/codex-claude-academic-skills: `npx skills add zLanqing/codex-claude-academic-skills --skill scikit-learn`
- scikit-learn from brycewang-stanford/Auto-Empirical-Research-Skills: `npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill scikit-learn`

## What it is
- scikit-learn is a Python module for machine learning built on top of SciPy, released under the 3-Clause BSD license. The README says David Cournapeau started it in 2007 as a Google Summer of Code project. It is now maintained by a community of volunteers, with support from several organisations. The latest release, 1.9.1, is a bug-fix release and the first version that supports Python 3.15.
- The FAQ describes the design goal as a unified API for the basic tasks in machine learning, with pipelines and meta-algorithms such as grid search connecting the parts. Most of the library assumes data arrives as NumPy arrays or SciPy sparse matrices of a single numeric dtype. It requires Python 3.12 or newer, plus NumPy, SciPy, Narwhals, joblib and threadpoolctl. Matplotlib is needed only for the plotting functions and classes, those that start with `plot_` or end with `Display`.
- The maintainers say plainly what the library does not try to do. Deep learning and reinforcement learning are out of scope. Graphical models and sequence prediction are not planned. GPU support is limited to an experimental Array API path. It is a library for standard estimators on tabular, numeric data, not a framework for neural networks.

## Caveats
- No deep or reinforcement learning: The FAQ says these do not fit the library's design constraints. The simple multilayer perceptron in `sklearn.neural_network` only receives bug fixes. For more complex models, the docs point to tensorflow, keras and pytorch.
- Categorical features need explicit encoding: Most of the library works on single-dtype numeric arrays, which have no explicit representation for categorical variables. You must convert categorical columns to numbers before most estimators can use them.
- Dataframes are converted internally: Dataframe support is described as "limited". Most estimators convert dataframe input into NumPy arrays or SciPy sparse matrices for computation. Dataframe output is generated back from those structures.
- Pipelines cannot transform the target: A pipeline transforms only the features X. For an invertible transform on y, the FAQ points to `TransformedTargetRegressor`. For resampling-style cases, it suggests a custom meta estimator.
- Tree models cannot use the GPU path: Cython-based tree models are not array-based algorithms, so the Array API cannot move them to GPU. k-means and k-nearest neighbors also rely on Cython "kernel fusion", which the Array API cannot express.

## Numbers (AgentGid data)
- Gid Score: 85.8 (#36 of all tools, 4 of 293 in its category)
- Used in 135 public projects set up for AI coding agents (2.2%)
- Downloads last week: 54,347,265 (as of 2026-11-24), +8.8% over 4 weeks
- GitHub stars: 68,304 (as of 2026-11-24)
- Last push: 2026-11-24

## Often used with
NumPy 86.7%, pandas 76.3%, Matplotlib 51.1%, Pydantic 49.6%, python-dotenv 49.6%, Requests 48.1%

## Links
- AgentGid page: https://agentgid.com/tools/scikit-learn/
- Homepage: https://scikit-learn.org
- Repository: https://github.com/scikit-learn/scikit-learn
- Source: https://github.com/scikit-learn/scikit-learn#readme
- Source: https://github.com/scikit-learn/scikit-learn
- Source: https://github.com/scikit-learn/scikit-learn/releases
- Source: https://scikit-learn.org/stable/faq.html

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
