Registry / type-stubs / scikit-learn-stubs

scikit-learn-stubs

JSON →
library0.0.3pypypiunverified

Type stubs for scikit-learn, providing static type information for type checkers like mypy and pyright. Current version 0.0.3, updated 2025; low release cadence. Maintained by Microsoft via the python-type-stubs repository, forked by hoel-bagard.

pip install scikit-learn-stubs
INSTALL
IMPORT
SIG · SCIKIT-LEARN-STUBS
S
scikit-learn-stubs
type-stubspythonv0.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LogisticRegression
from sklearn-stubs import LogisticRegression
from sklearn.linear_model import LogisticRegression

Basic scikit-learn usage with type stubs enabled. The stubs are automatically discovered by mypy/pyright when installed.

from sklearn.linear_model import LogisticRegression import numpy as np # Example usage with type hints (stubs enable type checking) model: LogisticRegression = LogisticRegression() X = np.array([[0, 0], [1, 1]]) y = np.array([0, 1]) model.fit(X, y) print(model.predict([[0.5, 0.5]]))
Debug
Known issues
gotchaStubs may not cover all scikit-learn modules or parameters, especially experimental ones. Use strict type checking cautiously.
fix
Check the stub coverage in the repository before relying on types for rarely used estimators.
affects: all
deprecatedThe original Microsoft python-type-stubs repository is archived. This fork may become outdated relative to new scikit-learn releases.
fix
Consider using the official scikit-learn type stubs from scikit-learn itself (if available in future) or contribute to this fork.
affects: 0.0.x
breakingVersion 0.0.x is pre-1.0. Breaking changes in stub types may occur between minor versions.
fix
Pin exact version in requirements: scikit-learn-stubs==0.0.3
affects: <1.0
Upgrade
Version history
0.0.3latest on PyPI · released Aug 28, 2025
Audit
Dependencies
scikit-learnrequiredRuntime dependency; stubs provide types for scikit-learn
typing_extensionsoptionalRequired for some type annotations
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
scikit-learn-stubs — pip install scikit-learn-stubs · libregistry