scikit-learn-stubs
scikit-learn stubs from the Microsoft python-type-stubs repository
What it is and what it does
scikit-learn-stubs is a type stub package that provides type hints for scikit-learn, enabling static type checkers like mypy and pyright to understand scikit-learn's API. Type stubs are metadata files that describe the types of functions, classes, and methods without executing code, allowing developers to catch type errors during development rather than at runtime.
The package is a PyPI distribution of stubs originally from Microsoft's Python Type Stubs repository. It has no runtime dependencies and is installed purely to support development-time type checking. The package supports Python 3.9 through 3.13 and carries an MIT license. However, the package is newly released and shows minimal ongoing maintenance, which may affect how current the stubs remain relative to scikit-learn's own API evolution.
Use it for:
- Enable mypy or pyright to type-check code that calls scikit-learn functions and classes.
- Improve IDE autocomplete and inline documentation for scikit-learn in editors that support type stubs.
- Catch type mismatches in machine learning pipelines during development before runtime.
- Support continuous integration pipelines that enforce static type checking on scikit-learn-dependent code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides type stubs for scikit-learn to enable static type checking in projects that use the library.
Yes, if you use scikit-learn and want static type checking in your project. Install it as a development dependency. However, verify that the stubs are current for your scikit-learn version, and monitor the repository for updates—the minimal maintenance signal and recent first release suggest this may not track scikit-learn changes closely. The Microsoft repository may be a more actively maintained alternative.
Install
scikit-learn-stubs on PyPI
pip
pip install scikit-learn-stubsuv
uv add scikit-learn-stubspoetry
poetry add scikit-learn-stubsInstalling scikit-learn-stubs
Before you install
Low friction install with no runtime dependencies. Package is newly released (first release 2025-08-27) and marked as aging after 351 days, with minimal maintenance activity and only 3 repository stars.
License in practice
MIT license is permissive and imposes no restrictions on use, modification, or distribution in your own projects.
Quickstart
pip install scikit-learn-stubs
# Then use with type checker (mypy, pyright, etc.)
# in your IDE or CI pipeline for scikit-learn code
Requires Python 3.9 or later; type checking tool (mypy, pyright, pylance) must be separately configured to use the stubs.
Verify before relying
- Whether stubs are kept in sync with scikit-learn releases given the minimal maintenance signal.
- Coverage completeness of the stubs relative to the full scikit-learn API surface.
- Whether this package is actively maintained or if the Microsoft repository is the recommended source.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 351 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 336,315/month — #7,462 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: scikit_learn_stubs-0.0.3-py3-none-any.whl
Keywords: scikit-learn, sklearn, stubs
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
sklearnA deprecated placeholder package that blocks…
unclear · top 5,000 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
pandas-stubsProvides type stubs for pandas, enabling static…
permissive · top 1,000 on PyPI
skopsSkops provides secure persistence and model…
unclear · top 5,000 on PyPI
scikerasSciKeras wraps Keras models to work with…
permissive · top 15,000 on PyPI
sklearndfWraps scikit-learn estimators to return pandas…
permissive · top 15,000 on PyPI
sklearn-compatProvides backward-compatible wrappers for…
permissive · top 5,000 on PyPI
sklearn-crfsuitesklearn-crfsuite wraps CRFsuite (Conditional…
permissive · top 15,000 on PyPI
scikit-learn-extraExtends scikit-learn with additional machine…
permissive · top 15,000 on PyPI