scikit-learn
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. |
scikit-learn is the standard library for classic machine learning in Python. Within the ML (Machine Learning) section it is the tool for tabular data and small to medium problems, where a well-tuned linear model, tree ensemble or kernel method often beats a neural network and is much cheaper to train. The full tour of the library, from installation and the estimator API to pipelines, validation and model persistence, lives in the Data Science scikit-learn sub-section. This sub-section does not repeat it: it adds the models and practices that are specific to machine learning and shows where scikit-learn hands over to deep-learning frameworks.
The names
The library is called scikit-learn, written with a hyphen and no capital letters apart from the start of a sentence. It is imported as sklearn and installed with pip as scikit-learn. People often write "Sci-kit learn" or "SciKit-Learn"; those spellings are not the project name. The "scikit" part comes from SciKits, add-on toolkits for SciPy, a family that also includes scikit-image. Search for scikit-learn, but write sklearn in import statements, and note that the old pip package name sklearn is not the library.
Version baseline
| Item | Value checked on 2026-10-30 |
|---|---|
scikit-learn |
1.9.1. The development series is 1.10 and is labelled upcoming wherever it is mentioned. |
Python |
Examples on these pages were run on 2026-10-31 with Python 3.13, scikit-learn 1.9.1, NumPy 2.5.4, SciPy 1.18.1 (1.17.1 on the Gaussian processes page) and pandas 3.1.0, on CPU. Each page states the libraries it used and names any example that needs hardware or a service that was not available (such as a CUDA GPU) and was therefore not executed. |
Related libraries |
PyTorch 2.15.0 (CPU), Keras 3.15.1, skorch 1.4.0, skl2onnx 1.20.0, ONNX 1.23.2, ONNX Runtime 1.31.1, imbalanced-learn 0.14.2, XGBoost 3.4.1, LightGBM 4.7.0, CatBoost 1.2.10, Optuna 5.0.0 and optuna-integration 5.0.0, used on the pages that bridge to them. |
Foundations from Data Science
The pages below belong to the Data Science section. They are the foundation for everything here, and the pages of this sub-section link to them instead of re-explaining them. Read the ones you do not know before the new pages.
New pages in this sub-section
Models beyond the data science pages
| Page | What it covers |
|---|---|
MLPClassifier and MLPRegressor, and their limits. |
|
Kernel ridge regression, kernel approximation and the Nystroem method. |
|
Gaussian process regression and classification, kernels and uncertainty. |
|
Linear and quadratic discriminant analysis. |
|
Isotonic regression and monotonic fits. |
|
Self-training and label propagation with unlabelled data. |
|
Multiclass, multilabel and multioutput strategies. |
|
Covariance estimators and kernel density estimation. |
|
PLS, CCA and random projection. |
Practice at scale
| Page | What it covers |
|---|---|
Imbalanced Data: class_weight, Thresholds & imbalanced-learn |
class_weight, decision thresholds and imbalanced-learn. |
HistGradientBoosting compared with XGBoost, LightGBM and CatBoost. |
|
Hyperparameter Tuning at Scale: Halving, Optuna & Parallelism |
Successive halving, Optuna and parallelism. |
Scaling strategies and out-of-core learning with partial_fit. |
|
Building custom estimators and transformers that follow the API. |
|
The experimental callbacks API for progress and scoring monitoring. |
|
A complete project from data to a saved pipeline. |
Related material on this site
The general tour of the library (installation, the estimator API, pipelines, validation and model persistence) is the Data Science scikit-learn sub-section; this one covers only the machine-learning-specific models and practices. See Classic ML Algorithms at a Glance for the map of algorithm families, Tabular Data: Gradient Boosting vs Deep Learning and Choosing a Framework. Return to the ML (Machine Learning) landing page for the whole section.
Bibliography
All official links below were opened on 2026-10-30. The sources of the reused pages are in the Data Science scikit-learn bibliography, and books and general sources for the whole section are in the ML bibliography.
scikit-learn sources
-
User Guide (1.9.1), What’s new in 1.9, Glossary, Choosing the right estimator and Related projects
-
Modules under https://scikit-learn.org/stable/modules/: neural_networks_supervised, neural_networks_unsupervised, kernel_ridge, kernel_approximation, metrics, gaussian_process, lda_qda, semi_supervised, isotonic, covariance, density, cross_decomposition, random_projection, multiclass, ensemble, grid_search, classification_threshold, model_evaluation, sgd, compose and array_api
-
Other pages: callbacks, developing estimators, model persistence, common pitfalls, scaling strategies, computational performance, parallelism and getting started
-
Examples under https://scikit-learn.org/stable/auto_examples/: plot_kernel_ridge_regression, plot_compare_gpr_krr and plot_cyclical_feature_engineering
-
Inria scikit-learn MOOC and scikit-learn-contrib project template
-
scikit-learn on PyPI (version checked on 2026-10-30)
Ecosystem sources
-
imbalanced-learn and its common pitfalls
-
skorch and the Keras scikit-learn wrappers
-
SciKeras (archived, legacy)
-
Optuna and OptunaSearchCV
-
sklearn-onnx and skops
Sources cited by individual pages
The official sources below are cited in the References section of one page each; a source shared by several pages is listed once, under the first page that cites it.
-
Imbalanced Data: class_weight, Thresholds & imbalanced-learn
-
Hyperparameter Tuning at Scale: Halving, Optuna & Parallelism
-
Scaling Strategies & Out-of-Core Learning
-
Sebastian Raschka, Python Machine Learning, Packt, 2015, chapter 8 (structure of the out-of-core sentiment-analysis example only): https://www.packtpub.com/en-us/product/python-machine-learning-9781783555130
Where older books are outdated
Books and tutorials written for scikit-learn 0.x or early 1.x still circulate, and much of their code no longer runs. The table maps the usual old idioms to what scikit-learn 1.9.1 provides; every name in the right-hand column was checked on 1.9.1.
| Old code | Status | Current replacement |
|---|---|---|
|
Deprecated in 0.18, removed in 0.20 |
|
|
Deprecated in 0.18, removed in 0.20 |
|
|
Removed in 0.19 |
|
|
Deprecated in 0.20, removed in 0.22 |
|
|
Deprecated in 0.20, removed in 0.22 |
|
|
Removed in 0.22 (mldata.org is gone) |
|
|
Removed in 1.2 for an ethical problem in the data; importing it raises |
|
|
Deprecated in 1.5, removed in 1.8 |
Plain |
|
Removed in NumPy 2.0 |
|
|
Still works, but loading a pickle (or a joblib file) can execute arbitrary code, and a model only loads reliably with the same scikit-learn version |
|
|
Deprecated in 1.9, removal planned for 1.11; 1.9.1 emits a |
|