What’s New in scikit-learn 1.6 to 1.9

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

This page was checked in October 2026 against the scikit-learn 1.9.1 release (September 2026) and the 1.10 development notes, on Python 3.13 with NumPy 2.5 and pandas 3.1. The probes and examples were run on those versions. It has two jobs: to summarise what the four most recent minor releases changed, and to list what older books and tutorials get wrong today, so that you can translate their code. Everything labelled "upcoming" is in the unreleased 1.10 development line and may change before release.

scikit-learn ships a minor release about every six months, with bug-fix releases in between. A deprecation normally lasts two minor releases: the first release warns, and the second one after it removes the feature. The warnings are FutureWarning or DeprecationWarning, so run your tests with warnings turned into errors before you upgrade (python -W error::FutureWarning -m pytest).

Releases at a glance

Timeline of scikit-learn 1.6, 1.7, 1.8 and 1.9, with 1.10 marked as upcoming
Figure 1. The four most recent minor releases and the upcoming 1.10.
Version Date Headline changes

1.6.0

December 2024

FrozenEstimator; Pipeline metadata transformation (transform_input); __sklearn_tags__ replaces the private tag helpers; wheels for free-threaded CPython 3.13; import sklearn is enough to reach submodules; cv="prefit" of CalibratedClassifierCV deprecated.

1.6.1

January 2025

Bug fixes; the old tag helpers raise DeprecationWarning instead of FutureWarning.

1.7.0

June 2025

Sparse arrays accepted next to sparse matrices; array-api-compat vendored; HistGradientBoosting* accept an explicit validation set; multiclass brier_score_loss; from_cv_results on RocCurveDisplay.

1.7.1 and 1.7.2

July and September 2025

Bug fixes.

1.8.0

December 2025 (the 10th)

Temperature scaling in CalibratedClassifierCV; ClassicalMDS; many more array API estimators and metrics; free-threaded CPython 3.14 wheels; penalty of LogisticRegression deprecated; confusion_matrix_at_thresholds.

1.9.0

June 2026 (the 2nd)

Callback API (experimental); metric_at_thresholds; the sparse_interface configuration; narwhals becomes a dependency; HTML representation with fitted attributes and output features; SVC(probability=...) deprecated.

1.9.1

September 2026 (the 10th)

Bug fixes in array API metrics, metadata routing, callbacks, DBSCAN, OPTICS and LinearDiscriminantAnalysis, plus a memory leak in LinearSVR and an out-of-bounds write in LinearSVC.

1.10 (upcoming)

Not yet released

Automatic metadata requests, stable IterativeImputer, categorical features in random forests, GLM L1 and elastic-net penalties and the removals scheduled for 1.10 in the deprecation table below. Development version 1.10.dev0.

Requirements today

Item Value for scikit-learn 1.9.1

Python

3.11 or newer.

Required packages

NumPy 1.24.1 or newer, SciPy 1.10.0 or newer, joblib 1.4.0 or newer, threadpoolctl 3.5.0 or newer and narwhals 2.0.1 or newer.

narwhals

A new, very lightweight dependency in 1.9 that simplifies dataframe input and the set_output dataframe output for pandas and polars. It replaced the dataframe interchange protocol (__dataframe__) that scikit-learn used before for non-pandas frames and that polars deprecated.

Optional

pandas, polars, Matplotlib (for the Display classes), PyArrow, rich (for the progress bar callback), and the array libraries of Array API and GPU Support.

The Python and package minimums come from the package metadata of the 1.9.1 wheel. Check Installation for the install commands.

Release by release

1.6 (December 2024)

  • FrozenEstimator. sklearn.frozen.FrozenEstimator freezes a fitted estimator: fit does nothing and clone returns the same object. It replaces CalibratedClassifierCV(cv="prefit"). See FrozenEstimator.

  • Pipeline metadata. Pipeline can transform metadata up to the step that needs it, through the transform_input parameter.

  • Estimator tags. __sklearn_tags__ is the new way to set estimator tags; the private helpers _more_tags, _get_tags and _safe_tags are deprecated (they raise DeprecationWarning from 1.6.1). Third-party estimators must inherit from BaseEstimator, which implements the new method. utils.validation.validate_data replaces the private _validate_data method.

  • Free-threaded Python. Preliminary support, with wheels for the experimental free-threaded CPython 3.13 on all supported platforms.

  • Lazy submodule access. import sklearn; sklearn.svm.SVC() now works without importing sklearn.svm.

  • Array API. Search classes (GridSearchCV, RandomizedSearchCV, HalvingGridSearchCV, HalvingRandomSearchCV) accept array API inputs when their base estimator does. Support for cupy.array_api was removed in favour of the top-level cupy module.

  • Deprecations that followed. AdaBoostClassifier(algorithm=...) (removal announced for 1.8; the SAMME.R value itself was deprecated in 1.4), force_all_finite (renamed ensure_all_finite, removal announced for 1.8), scoring="max_error" (use "neg_max_error"), and the default response_method=None of make_scorer.

1.7 (June 2025)

  • Sparse arrays. As part of the SciPy move from spmatrix to sparray, internal code accepts both. Input of either kind works.

  • Vendored array libraries. array-api-compat and array-api-extra ship inside scikit-learn, so array API users no longer install array-api-compat themselves.

  • HistGradientBoosting. X_val, y_val and sample_weight_val can be passed to fit to control the early-stopping validation set.

  • Metrics. brier_score_loss supports multiclass problems and has a scale_by_half argument; RocCurveDisplay.from_cv_results plots curves from cross_validate results; in RocCurveDisplay.from_predictions the argument y_pred was renamed y_score.

  • Estimators. DictionaryLearning and SparseCoder gained inverse_transform; the neural network estimators accept sample_weight; mixture models store lower_bounds_.

  • Deprecations. liblinear with a one-versus-rest multiclass scheme in LogisticRegression (an error from 1.8; wrap in OneVsRestClassifier), n_alphas in the cross-validated Lasso and Elastic-Net classes (use alphas with an integer), force_int_remainder_cols in ColumnTransformer, and integer columns in partial_dependence.

1.8 (December 2025)

  • Calibration. CalibratedClassifierCV has method="temperature".

  • Manifold learning. ClassicalMDS (classical multidimensional scaling) was added; MDS accepts arbitrary metrics.

  • Array API. StandardScaler, RidgeCV, RidgeClassifier, GaussianMixture, PolynomialFeatures, GaussianNB, cross_val_predict and many metrics gained support.

  • Free-threaded Python 3.14. Wheels are available for all supported platforms on the free-threaded CPython 3.14, which the project recommends over 3.13 for trying free-threading.

  • Metrics. confusion_matrix_at_thresholds and d2_brier_score.

  • Linear models. penalty of LogisticRegression and LogisticRegressionCV is deprecated: use l1_ratio (0 for L2, 1 for L1, in between for elastic net) and C=np.inf for no regularisation. n_jobs of LogisticRegression is deprecated because it has had no effect since 1.8. PassiveAggressiveClassifier and PassiveAggressiveRegressor are deprecated in favour of SGDClassifier and SGDRegressor with learning_rate="pa1" or "pa2".

  • Discriminant analysis. QuadraticDiscriminantAnalysis gained solver, covariance_estimator and shrinkage.

1.9 (June 2026, 1.9.1 in September 2026)

  • Callback API (experimental). set_callbacks attaches callbacks to the fit of supporting estimators. sklearn.callback.ProgressBar (needs rich) and sklearn.callback.ScoringMonitor ship with it. LogisticRegression (with solver="lbfgs"), the search classes, Pipeline and StandardScaler support callbacks. The API may change without the usual deprecation cycle.

  • Thresholds. metric_at_thresholds computes a metric at every threshold for the decision-threshold workflow; PrecisionRecallDisplay.from_cv_results plots several curves.

  • Sparse interface. The configuration key sparse_interface chooses whether functions return SciPy sparse matrices ("spmatrix", the default) or sparse arrays ("sparray"). The plan is to change the default to "sparray" in a few releases.

  • narwhals. The new dependency described above.

  • HTML representation. Estimators display a table of their fitted attributes (public attributes ending in an underscore) and, for ColumnTransformer and FeatureUnion, the names of the output features with a copy button.

  • Zero weights. A ValueError is raised when sample_weight contains only zeros, in all estimators that accept it.

  • Array API. LogisticRegression and PoissonRegressor (with solver="lbfgs"), FeatureUnion, Nystroem, RidgeCV and more metrics gained support; the move_estimator_to utility was added.

  • Deprecations. SVC(probability=...) and NuSVC(probability=...), with the probA_ and probB_ attributes (use CalibratedClassifierCV(SVC(), ensemble=False)); shuffle and random_state of TargetEncoder (pass a splitter as cv); criterion="friedman_mse" for trees and the criterion parameter of gradient boosting; n_alphas in lasso_path and enet_path; positional sample_weight in LogisticRegressionCV.score.

  • Removed in 1.9. n_alphas in the cross-validated Lasso and Elastic-Net classes (LassoCV, ElasticNetCV and their multi-task variants; pass an integer to alphas) and force_int_remainder_cols in ColumnTransformer. Passing either raises a TypeError.

  • Behaviour changes. PowerTransformer(method="yeo-johnson") uses scipy.stats.yeojohnson, so results can differ in the last digits; random forests and extra trees draw samples using sample_weight; MiniBatchKMeans handles sample weights correctly; LinearDiscriminantAnalysis with solver="svd" normalises like solver="eigen" (1.9.1).

  • 1.9.1 fixes. Array API metrics accept pandas labels; metadata is routed to sub-estimators of SelectFromModel, RFE, RFECV, SequentialFeatureSelector and IterativeImputer inside pipelines, and BaggingClassifier and TransformedTargetRegressor route it correctly; ScoringMonitor works with multi-process backends; DBSCAN and OPTICS stop warning on precomputed sparse matrices; fetch_openml recovers from a corrupted download; memory leaks and an out-of-bounds write in LinearSVR and LinearSVC were fixed.

1.10 (upcoming)

The development notes (1.10.dev0, October 2026) list changes that are not in any release yet.

  • Metadata auto-requests. set_config(enable_metadata_auto_requests=True) lets estimators, scorers and splitters request common metadata such as sample_weight automatically; HistGradientBoosting* auto-request X_val, y_val and sample_weight_val.

  • IterativeImputer. No longer experimental: import it from sklearn.impute, and the old enabling import becomes a warning and a no-op. On 1.9.1 you still need from sklearn.experimental import enable_iterative_imputer.

  • Experimental import. sklearn.experimental.enable_hist_gradient_boosting is deprecated (removal in 1.12).

  • Random forests. categorical_features for RandomForest* and ExtraTrees*, including "from_dtype", which is planned to become the default in 1.13.

  • GLMs and logistic regression. New newton-cd and newton-cd-gram solvers and L1 and elastic-net penalties for GammaRegressor, PoissonRegressor and TweedieRegressor.

  • Parametrisation. C of LogisticRegression and Cs of LogisticRegressionCV are deprecated in favour of alpha and alphas (alpha = 1 / C), with removal planned for 1.14.

  • Array API. More estimators and metrics (LedoitWolf, OAS, LogisticRegressionCV, matthews_corrcoef) and fixes for mixed namespaces.

  • Changed models. QuantileTransformer estimates quantiles differently and no longer caps n_quantiles at n_samples; HistGradientBoosting* draw the per-split feature subset differently when max_features < 1.0; partial_dependence computes its grid with numpy.nanquantile.

Deprecations in force and removals to expect

The first column lists code that still runs on 1.9.1 but warns.

Deprecated code Use instead Removal Notes

LogisticRegression(penalty=...), LogisticRegressionCV(penalty=...)

l1_ratio, C (or Cs)

1.10

Deprecated in 1.8. Running it on 1.9.1 raises FutureWarning: "'penalty' was deprecated in version 1.8 and will be removed in 1.10".

LogisticRegression(n_jobs=...)

nothing; the parameter has no effect

1.10

Deprecated in 1.8.

PassiveAggressiveClassifier, PassiveAggressiveRegressor

SGDClassifier, SGDRegressor with learning_rate="pa1" or "pa2"

1.10

Deprecated in 1.8.

SVC(probability=True), NuSVC(probability=True)

CalibratedClassifierCV(SVC(), ensemble=False)

1.11

Deprecated in 1.9 because it is not thread-safe. Running it on 1.9.1 raises FutureWarning.

TargetEncoder(shuffle=..., random_state=...)

TargetEncoder(cv=KFold(5, shuffle=True, random_state=0))

1.11

Deprecated in 1.9.

LogisticRegressionCV.score(X, y, sample_weight) positional

sample_weight= keyword

1.11

Deprecated in 1.9.

LogisticRegressionCV default scoring=None (accuracy)

pass scoring explicitly

default changes in 1.11

The default will become "neg_log_loss", aligned with the loss the model minimises.

sklearn.experimental.enable_hist_gradient_boosting

from sklearn.ensemble import HistGradientBoostingClassifier

1.12 (upcoming)

Importing it on 1.9.1 emits a UserWarning saying it has not been needed since 1.0.

Run the new features

A callback that records a score at each iteration

from sklearn.callback import ScoringMonitor
from sklearn.datasets import make_classification
from sklearn.linear_model import LogisticRegression

X, y = make_classification(random_state=0)
monitor = ScoringMonitor(scoring="accuracy")
clf = LogisticRegression(solver="lbfgs", max_iter=50).set_callbacks(monitor)
clf.fit(X, y)

log = monitor.get_logs()
df = log.data_as_pandas
print(type(log).__name__)
print(df.columns.tolist())
print(df[["task_name", "accuracy"]].head())
print(len(df))

Output:

ScoringMonitorLog
['task_id_path', 'parent_task_id_path', 'estimator_name', 'task_name', 'task_id', 'sequential_subtasks', 'accuracy']
    task_name  accuracy
0         fit      0.94
1  lbfgs-iter      0.88
2  lbfgs-iter      0.89
3  lbfgs-iter      0.92
4  lbfgs-iter      0.92
11

The monitor scores the model on the training data at each lbfgs iteration and stores the rows in a log that converts to a pandas frame. The API is experimental: the column names and the way get_logs groups runs may change.

A metric at every threshold

import numpy as np
from sklearn.datasets import make_classification
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import f1_score, metric_at_thresholds
from sklearn.model_selection import train_test_split

X, y = make_classification(n_samples=300, random_state=0)
X_tr, X_te, y_tr, y_te = train_test_split(X, y, random_state=0)
scores = LogisticRegression().fit(X_tr, y_tr).predict_proba(X_te)[:, 1]

values, thresholds = metric_at_thresholds(y_te, scores, f1_score)
best = int(np.argmax(values))
print(values.shape, thresholds.shape)
print(round(float(thresholds[best]), 3), round(float(values[best]), 3))

Output:

(75,) (75,)
0.684 0.932

metric_at_thresholds(y_true, y_score, metric_func, ...) calls metric_func for the predictions obtained at each distinct score threshold, so you can plot or maximise any metric. Choosing a threshold on the same data you evaluate on is optimistic; use a validation set, or TunedThresholdClassifierCV, as in Tuning the Decision Threshold.

Sparse arrays instead of sparse matrices

import sklearn
from sklearn.preprocessing import OneHotEncoder

data = [["a"], ["b"], ["a"]]
print(type(OneHotEncoder().fit_transform(data)).__name__, sklearn.get_config()["sparse_interface"])

sklearn.set_config(sparse_interface="sparray")
print(type(OneHotEncoder().fit_transform(data)).__name__)
sklearn.set_config(sparse_interface="spmatrix")

Output:

csr_matrix spmatrix
csr_array

Where older books and tutorials are outdated

Learning material about scikit-learn ages quickly, because the project removes deprecated code after two releases. The tables below translate what you will meet in older books and tutorials. They list API names and release dates, not book text. Wherever a book and the official documentation disagree, the official documentation of the current release wins.

Names that no longer exist

The probe below imports or calls each legacy name on scikit-learn 1.9.1 and prints the kind of error it produces.

import importlib
import warnings

import numpy as np

warnings.simplefilter("ignore")
rng = np.random.RandomState(0)
X = rng.rand(30, 3)
y = rng.randint(0, 3, 30)

def status(fn):
    try:
        fn()
        return "works"
    except Exception as exc:
        return type(exc).__name__

def imp(code):
    return lambda: exec(code, {})

from sklearn.cluster import AgglomerativeClustering
from sklearn.ensemble import AdaBoostClassifier, BaggingClassifier
from sklearn.linear_model import LogisticRegression, RidgeCV
from sklearn.manifold import TSNE
from sklearn.preprocessing import OneHotEncoder
from sklearn.utils import check_array

probes = [
    ("import sklearn.cross_validation", lambda: importlib.import_module("sklearn.cross_validation")),
    ("import sklearn.grid_search", lambda: importlib.import_module("sklearn.grid_search")),
    ("import sklearn.learning_curve", lambda: importlib.import_module("sklearn.learning_curve")),
    ("import sklearn.externals.joblib", lambda: importlib.import_module("sklearn.externals.joblib")),
    ("preprocessing.Imputer", imp("from sklearn.preprocessing import Imputer")),
    ("preprocessing.CategoricalEncoder", imp("from sklearn.preprocessing import CategoricalEncoder")),
    ("datasets.load_boston", imp("from sklearn.datasets import load_boston")),
    ("datasets.fetch_mldata", imp("from sklearn.datasets import fetch_mldata")),
    ("metrics.plot_confusion_matrix", imp("from sklearn.metrics import plot_confusion_matrix")),
    ("metrics.plot_roc_curve", imp("from sklearn.metrics import plot_roc_curve")),
    ("OneHotEncoder(sparse=False)", lambda: OneHotEncoder(sparse=False)),
    ("OneHotEncoder().get_feature_names()", lambda: OneHotEncoder().fit([["a"], ["b"]]).get_feature_names()),
    ("BaggingClassifier(base_estimator=...)", lambda: BaggingClassifier(base_estimator=None)),
    ("AdaBoostClassifier(algorithm=...)", lambda: AdaBoostClassifier(algorithm="SAMME.R")),
    ("AgglomerativeClustering(affinity=...)", lambda: AgglomerativeClustering(affinity="euclidean")),
    ("TSNE(n_iter=...)", lambda: TSNE(n_iter=250)),
    ("RidgeCV(store_cv_values=...)", lambda: RidgeCV(store_cv_values=True)),
    ("check_array(force_all_finite=...)", lambda: check_array([[1.0]], force_all_finite=True)),
    ("LogisticRegression(multi_class=...)", lambda: LogisticRegression(multi_class="ovr")),
    ("LogisticRegression(0.5) positional", lambda: LogisticRegression("l2", 0.5)),
]
for name, fn in probes:
    print(f"{name:42s} {status(fn)}")

with warnings.catch_warnings(record=True) as caught:
    warnings.simplefilter("always")
    LogisticRegression(penalty="l2").fit(X, y)
    print("LogisticRegression(penalty='l2')          ", caught[0].category.__name__)

Output:

import sklearn.cross_validation            ModuleNotFoundError
import sklearn.grid_search                 ModuleNotFoundError
import sklearn.learning_curve              ModuleNotFoundError
import sklearn.externals.joblib            ModuleNotFoundError
preprocessing.Imputer                      ImportError
preprocessing.CategoricalEncoder           ImportError
datasets.load_boston                       ImportError
datasets.fetch_mldata                      ImportError
metrics.plot_confusion_matrix              ImportError
metrics.plot_roc_curve                     ImportError
OneHotEncoder(sparse=False)                TypeError
OneHotEncoder().get_feature_names()        AttributeError
BaggingClassifier(base_estimator=...)      TypeError
AdaBoostClassifier(algorithm=...)          TypeError
AgglomerativeClustering(affinity=...)      TypeError
TSNE(n_iter=...)                           TypeError
RidgeCV(store_cv_values=...)               TypeError
check_array(force_all_finite=...)          TypeError
LogisticRegression(multi_class=...)        TypeError
LogisticRegression(0.5) positional         TypeError
LogisticRegression(penalty='l2')           FutureWarning
Old code you will see Current code Dates from the release notes

sklearn.cross_validation, sklearn.grid_search, sklearn.learning_curve; grid_scores_

sklearn.model_selection; cv_results_

Moved in 0.18 (September 2016).

preprocessing.Imputer

impute.SimpleImputer

New module in 0.20 (September 2018).

CategoricalEncoder

OneHotEncoder and OrdinalEncoder, usually inside ColumnTransformer

Never released in a final version; 0.20 extended the encoders instead.

sklearn.externals.joblib

import joblib

Deprecated in 0.21 (May 2019).

datasets.fetch_mldata

fetch_openml, fetch_california_housing

Deprecated in 0.20 for removal in 0.22; mldata.org is gone.

datasets.load_boston

fetch_california_housing, fetch_openml

Deprecated in 1.0 (September 2021), removed in 1.2 (December 2022).

metrics.plot_confusion_matrix, plot_roc_curve, plot_precision_recall_curve

ConfusionMatrixDisplay, RocCurveDisplay, PrecisionRecallDisplay with from_estimator or from_predictions

Deprecated in 1.0, removed in 1.2.

get_feature_names() of transformers

get_feature_names_out()

get_feature_names_out appeared in 1.0; the old method is gone.

OneHotEncoder(sparse=False)

OneHotEncoder(sparse_output=False)

Deprecated in 1.2, removal announced for 1.4.

base_estimator= in BaggingClassifier, AdaBoostClassifier and SelfTrainingClassifier

estimator=

Renamed over 1.2 to 1.6; absent on 1.9.1.

AgglomerativeClustering(affinity=...)

metric=...

Renamed over 1.2 to 1.4.

AdaBoostClassifier(algorithm="SAMME.R")

nothing: SAMME is the only algorithm

SAMME.R deprecated in 1.4, the whole parameter deprecated in 1.6 and removed in 1.8.

TSNE(n_iter=...)

TSNE(max_iter=...)

Deprecated in 1.5, removal announced for 1.7.

RidgeCV(store_cv_values=...), cv_values_

store_cv_results, cv_results_

Deprecated in 1.5.

force_all_finite=... in check_array and friends

ensure_all_finite=...

Deprecated in 1.6, removal announced for 1.8.

LogisticRegression(multi_class=...)

nothing for three or more classes (multinomial); OneVsRestClassifier(LogisticRegression()) for one-versus-rest

Deprecated in 1.5, removal announced for 1.8.

LogisticRegression(penalty=...)

l1_ratio and C

Deprecated in 1.8, removal in 1.10. See the table above.

SVC(probability=True)

CalibratedClassifierCV(SVC(), ensemble=False)

Deprecated in 1.9, removal in 1.11.

CalibratedClassifierCV(clf, cv="prefit")

CalibratedClassifierCV(FrozenEstimator(clf))

Deprecated in 1.6; rejected on 1.9.1.

Positional hyper-parameters such as LogisticRegression("l2", 0.5)

Keyword arguments

Enforced since 1.0; the probe shows TypeError.

Defaults that changed in 0.22

Code written before December 2019 (scikit-learn 0.22.0 was released on December 3, 2019) may assume the old defaults. These are the current values, confirmed on 1.9.1.

Setting Current default Used to be

RandomForestClassifier(n_estimators=...)

100

10

cross_val_score(..., cv=None) and other searches

5 folds

3 folds

LogisticRegression(solver=...)

"lbfgs"

"liblinear"

SVC(gamma=...)

"scale"

"auto"

Other defaults that moved later: KMeans(n_init="auto") since 1.4 (older code often passes n_init=10), keyword-only arguments since 1.0, and fetch_openml(as_frame="auto"), which returns a DataFrame by default, so code that indexes the result as an array, such as X[0], fails.

Other statements to watch for

  • Seeding. Tutorials call np.random.seed(42) and then rely on global state. scikit-learn recommends passing random_state explicitly; see Common Pitfalls.

  • StratifiedKFold(random_state=...) without shuffle=True. It raises ValueError.

  • Experimental imports. HistGradientBoosting* is stable and its enabling import is a warning today. IterativeImputer and the halving searches still need their sklearn.experimental imports on 1.9.1.

  • TargetEncoder. fit(X, y).transform(X) differs from fit_transform(X, y), which cross-fits to avoid leakage.

  • set_output. Pandas output arrived in 1.2 and polars output in 1.4; dataframe handling now rests on narwhals. On 1.9.1 with pandas 3.1, make_column_selector(dtype_include=object) still selects the new str columns, so older pandas code keeps working.

  • Pickled models. Loading a model in a different scikit-learn version is unsupported. See Model Persistence and Security.

  • Python 2 code. print statements, integer division, xrange and import pylab need translating before anything else.

Reading books and tutorials by their scikit-learn era

Source and year Targets What to translate

Géron, Hands-On Machine Learning with Scikit-Learn and TensorFlow (O’Reilly, 2017)

scikit-learn about 0.18

Imputer, LabelBinarizer inside pipelines, fetch_mldata, hand-written DataFrameSelector with FeatureUnion (use ColumnTransformer), global seeding and SAMME.R.

Géron, Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow, 2nd edition (O’Reilly, 2019, early release copy)

scikit-learn 0.20 to 0.22

StratifiedKFold(random_state=...) without shuffle, multi_class=, SAMME.R, OneHotEncoder(sparse=...), the Keras wrapper in keras.wrappers.scikit_learn, and fetch_openml results indexed like arrays.

Géron, Hands-On Machine Learning with Scikit-Learn and PyTorch (O’Reilly, 2025)

scikit-learn 1.5 or newer

The most current of the books. It predates 1.7 to 1.9 and pandas 3, so expect inplace=True and .values habits, and check selectors that use dtype_include=object (they still work on 1.9.1).

Igual and Seguí, Introduction to Data Science (Springer, 2017)

Python 2.7, scikit-learn before 0.20

sklearn.cross_validation, grid_search, KFold(n=...), .ix, DataFrame.append, Python 2 print; no pipelines or leakage discussion.

McKinney, Python for Data Analysis, 2nd edition (O’Reilly, 2017)

pandas about 0.20, a short scikit-learn section

Mostly pandas; use the open-access 3rd edition instead where possible.

Marsland, Machine Learning: An Algorithmic Perspective, 2nd edition (CRC Press, 2015)

Python 2 and NumPy

Valuable for from-scratch theory; Python 2 print and pylab imports need translating, and it does not use scikit-learn.

Skansi, Introduction to Deep Learning (Springer, 2018)

Python 3.5 or 3.6, standalone Keras 2

Use train_test_split instead of an unseeded random mask; Keras imports have moved.

Skiena, The Data Science Design Manual (Springer, 2017)

language-agnostic

No library code to update; the conceptual advice on baselines and evaluation still holds.

None of the books covers FrozenEstimator, array API dispatch, set_output, metadata routing, the callback API, or the modern leakage and reproducibility practices on this page and in Common Pitfalls; those topics come only from the official documentation.

Staying current

  • Subscribe to the release history and read the "API Change" lines first.

  • Run your tests with -W error::FutureWarning -W error::DeprecationWarning on a CI job that installs the newest release.

  • Pin the minor version of scikit-learn in the environment that trains and serves a model, and rebuild the model when you upgrade; see Model Persistence and Security.

  • Treat anything labelled experimental (array API, callbacks, sparse_interface defaults) as subject to change without a deprecation cycle.