scikit-learn is a Python module for machine learning built on top of SciPy. It's the standard library for classical (non-deep-learning) machine learning in Python: classification, regression, clustering, dimensionality reduction, and model selection, all exposed through a consistent, well-documented API. It's aimed at data scientists, researchers, and developers who need reliable, well-tested implementations of standard machine learning algorithms without writing them from scratch or wiring together lower-level numerical libraries themselves.
plot_ and classes ending in Display provide built-in visualization for model results, when Matplotlib is installed.scikit-learn is the default choice for classical machine learning tasks on structured/tabular data: building and evaluating classifiers or regressors, clustering unlabeled data, reducing dimensionality before visualization or modeling, and building preprocessing and modeling pipelines that need to be reproducible and easy to hand off to other Python developers. Its consistent API also makes it a common teaching tool, since the same fit/predict pattern applies across nearly every algorithm in the library.
It is not a deep learning framework. scikit-learn doesn't provide GPU-accelerated neural network training, automatic differentiation, or the building blocks for custom deep architectures; for that, frameworks like PyTorch or TensorFlow are the appropriate tools. It's also not built for datasets that don't fit in memory or need distributed training across a cluster by default, since it's designed around in-memory NumPy/SciPy arrays rather than a distributed compute model.
For help beyond the documentation, the project runs GitHub Discussions and a Discord server for developer and support questions, a long-running mailing list for broader discussion, and a public community calendar, in addition to the large volume of scikit-learn questions already answered on Stack Overflow. The project also maintains a changelog documenting notable changes across releases, and official logos and branding assets are published for anyone writing or presenting about it.
If you already have NumPy and SciPy installed, the simplest install is via pip:
pip install -U scikit-learn
Or via conda:
conda install -c conda-forge scikit-learn
Required dependencies are Python 3.11+, NumPy 1.24.1+, SciPy 1.10.0+, Narwhals 2.0.1+, joblib 1.4.0+, and threadpoolctl 3.5.0+. Plotting functions and classes (those prefixed plot_ or ending in Display) additionally require Matplotlib 3.6.1+.
To work from the latest source instead of a released version:
git clone https://github.com/scikit-learn/scikit-learn.git
After installation, the test suite can be run from outside the source directory with pytest 7.1.2 or newer:
pytest sklearn
The SKLEARN_SEED environment variable can be set to control random number generation during testing, useful for reproducing test failures.