{"id":27376,"library":"scikit-learn-stubs","title":"scikit-learn-stubs","description":"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.","status":"active","version":"0.0.3","language":"python","source_language":"en","source_url":"https://github.com/hoel-bagard/scikit-learn-stubs","tags":["scikit-learn","type-stubs","mypy","pyright","type-hints"],"install":[{"cmd":"pip install scikit-learn-stubs","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"Runtime dependency; stubs provide types for scikit-learn","package":"scikit-learn","optional":false},{"reason":"Required for some type annotations","package":"typing_extensions","optional":true}],"imports":[{"wrong":"from sklearn.linear_model import LogisticRegression","symbol":"LogisticRegression","correct":"from sklearn-stubs import LogisticRegression"}],"quickstart":{"code":"from sklearn.linear_model import LogisticRegression\nimport numpy as np\n\n# Example usage with type hints (stubs enable type checking)\nmodel: LogisticRegression = LogisticRegression()\nX = np.array([[0, 0], [1, 1]])\ny = np.array([0, 1])\nmodel.fit(X, y)\nprint(model.predict([[0.5, 0.5]]))","lang":"python","description":"Basic scikit-learn usage with type stubs enabled. The stubs are automatically discovered by mypy/pyright when installed."},"warnings":[{"fix":"Check the stub coverage in the repository before relying on types for rarely used estimators.","message":"Stubs may not cover all scikit-learn modules or parameters, especially experimental ones. Use strict type checking cautiously.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider using the official scikit-learn type stubs from scikit-learn itself (if available in future) or contribute to this fork.","message":"The original Microsoft python-type-stubs repository is archived. This fork may become outdated relative to new scikit-learn releases.","severity":"deprecated","affected_versions":"0.0.x"},{"fix":"Pin exact version in requirements: scikit-learn-stubs==0.0.3","message":"Version 0.0.x is pre-1.0. Breaking changes in stub types may occur between minor versions.","severity":"breaking","affected_versions":"<1.0"}],"env_vars":null,"search_vec":"'0.0.3':24 '2025':26 'bagard':44 'cadenc':29 'checker':17 'current':22 'fork':40 'hint':55 'hoel':43 'hoel-bagard':42 'inform':14 'learn':3,10,47 'like':18 'low':27 'maintain':30 'microsoft':32 'mypi':19,51 'provid':11 'pyright':21,52 'python':36 'python-type-stub':35 'releas':28 'repositori':39 'scikit':2,9,46 'scikit-learn':8,45 'scikit-learn-stub':1 'static':12 'stub':4,6,38,50 'type':5,13,16,37,49,54 'type-hint':53 'type-stub':48 'updat':25 'version':23 'via':33","created_at":"2026-05-01T17:45:56.858190+00:00","updated_at":"2026-05-01T17:45:56.858190+00:00","problems":{"verify_error":"File \"<string>\", line 1\n    from sklearn-stubs import LogisticRegression\n                ^\nSyntaxError: invalid syntax"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/hoel-bagard/scikit-learn-stubs","docs":null,"changelog":null,"pypi":"https://pypi.org/project/scikit-learn-stubs/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}