From e9752287ffffecb2d2878ce1ed97a77a43941579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Tue, 9 Dec 2025 14:25:05 +0100 Subject: [PATCH 01/19] DOC Release highlights for 1.8 (#32809) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Christian Lorentzen Co-authored-by: Olivier Grisel Co-authored-by: Virgil Chan Co-authored-by: Omar Salman Co-authored-by: Tim Head Co-authored-by: Jérémie du Boisberranger --- .../plot_release_highlights_1_8_0.py | 288 ++++++++++++++++++ 1 file changed, 288 insertions(+) create mode 100644 examples/release_highlights/plot_release_highlights_1_8_0.py diff --git a/examples/release_highlights/plot_release_highlights_1_8_0.py b/examples/release_highlights/plot_release_highlights_1_8_0.py new file mode 100644 index 0000000000000..3414a512724f4 --- /dev/null +++ b/examples/release_highlights/plot_release_highlights_1_8_0.py @@ -0,0 +1,288 @@ +# ruff: noqa: CPY001 +""" +======================================= +Release Highlights for scikit-learn 1.8 +======================================= + +.. currentmodule:: sklearn + +We are pleased to announce the release of scikit-learn 1.8! Many bug fixes +and improvements were added, as well as some key new features. Below we +detail the highlights of this release. **For an exhaustive list of +all the changes**, please refer to the :ref:`release notes `. + +To install the latest version (with pip):: + + pip install --upgrade scikit-learn + +or with conda:: + + conda install -c conda-forge scikit-learn + +""" + +# %% +# Array API support (enables GPU computations) +# -------------------------------------------- +# The progressive adoption of the Python array API standard in +# scikit-learn means that PyTorch and CuPy input arrays +# are used directly. This means that in scikit-learn estimators +# and functions non-CPU devices, such as GPUs, can be used +# to perform the computation. As a result performance is improved +# and integration with these libraries is easier. +# +# In scikit-learn 1.8, several estimators and functions have been updated to +# support array API compatible inputs, for example PyTorch tensors and CuPy +# arrays. +# +# Array API support was added to the following estimators: +# :class:`preprocessing.StandardScaler`, +# :class:`preprocessing.PolynomialFeatures`, :class:`linear_model.RidgeCV`, +# :class:`linear_model.RidgeClassifierCV`, :class:`mixture.GaussianMixture` and +# :class:`calibration.CalibratedClassifierCV`. +# +# Array API support was also added to several metrics in :mod:`sklearn.metrics` +# module, see :ref:`array_api_supported` for more details. +# +# Please refer to the :ref:`array API support` page for instructions +# to use scikit-learn with array API compatible libraries such as PyTorch or CuPy. +# Note: Array API support is experimental and must be explicitly enabled both +# in SciPy and scikit-learn. +# +# Here is an excerpt of using a feature engineering preprocessor on the CPU, +# followed by :class:`calibration.CalibratedClassifierCV` +# and :class:`linear_model.RidgeCV` together on a GPU with the help of PyTorch: +# +# .. code-block:: python +# +# ridge_pipeline_gpu = make_pipeline( +# # Ensure that all features (including categorical features) are preprocessed +# # on the CPU and mapped to a numerical representation. +# feature_preprocessor, +# # Move the results to the GPU and perform computations there +# FunctionTransformer( +# lambda x: torch.tensor(x.to_numpy().astype(np.float32), device="cuda")) +# , +# CalibratedClassifierCV( +# RidgeClassifierCV(alphas=alphas), method="temperature" +# ), +# ) +# with sklearn.config_context(array_api_dispatch=True): +# cv_results = cross_validate(ridge_pipeline_gpu, features, target) +# +# +# See the `full notebook on Google Colab +# `_ +# for more details. On this particular example, using the Colab GPU vs using a +# single CPU core leads to a 10x speedup which is quite typical for such workloads. + +# %% +# Free-threaded CPython 3.14 support +# ---------------------------------- +# +# scikit-learn has support for free-threaded CPython, in particular +# free-threaded wheels are available for all of our supported platforms on Python +# 3.14. +# +# We would be very interested by user feedback. Here are a few things you can +# try: +# +# - install free-threaded CPython 3.14, run your favourite +# scikit-learn script and check that nothing breaks unexpectedly. +# Note that CPython 3.14 (rather than 3.13) is strongly advised because a +# number of free-threaded bugs have been fixed since CPython 3.13. +# - if you use some estimators with a `n_jobs` parameter, try changing the +# default backend to threading with `joblib.parallel_config` as in the +# snippet below. This could potentially speed-up your code because the +# default joblib backend is process-based and incurs more overhead than +# threads. +# +# .. code-block:: python +# +# grid_search = GridSearchCV(clf, param_grid=param_grid, n_jobs=4) +# with joblib.parallel_config(backend="threading"): +# grid_search.fit(X, y) +# +# - don't hesitate to report any issue or unexpected performance behaviour by +# opening a `GitHub issue `_! +# +# Free-threaded (also known as nogil) CPython is a version of CPython that aims +# to enable efficient multi-threaded use cases by removing the Global +# Interpreter Lock (GIL). +# +# For more details about free-threaded CPython see `py-free-threading doc +# `_, in particular `how to install a +# free-threaded CPython `_ +# and `Ecosystem compatibility tracking `_. +# +# In scikit-learn, one hope with free-threaded Python is to more efficiently +# leverage multi-core CPUs by using thread workers instead of subprocess +# workers for parallel computation when passing `n_jobs>1` in functions or +# estimators. Efficiency gains are expected by removing the need for +# inter-process communication. Be aware that switching the default joblib +# backend and testing that everything works well with free-threaded Python is an +# ongoing long-term effort. + +# %% +# Temperature scaling in `CalibratedClassifierCV` +# ----------------------------------------------- +# Probability calibration of classifiers with temperature scaling is available in +# :class:`calibration.CalibratedClassifierCV` by setting `method="temperature"`. +# This method is particularly well suited for multiclass problems because it provides +# (better) calibrated probabilities with a single free parameter. This is in +# contrast to all the other available calibrations methods +# which use a "One-vs-Rest" scheme that adds more parameters for each class. + +from sklearn.calibration import CalibratedClassifierCV +from sklearn.datasets import make_classification +from sklearn.naive_bayes import GaussianNB + +X, y = make_classification(n_classes=3, n_informative=8, random_state=42) +clf = GaussianNB().fit(X, y) +sig = CalibratedClassifierCV(clf, method="sigmoid", ensemble=False).fit(X, y) +ts = CalibratedClassifierCV(clf, method="temperature", ensemble=False).fit(X, y) + +# %% +# The following example shows that temperature scaling can produce better calibrated +# probabilities than sigmoid calibration in multi-class classification problem +# with 3 classes. + +import matplotlib.pyplot as plt + +from sklearn.calibration import CalibrationDisplay + +fig, axes = plt.subplots( + figsize=(8, 4.5), + ncols=3, + sharey=True, +) +for i, c in enumerate(ts.classes_): + CalibrationDisplay.from_predictions( + y == c, clf.predict_proba(X)[:, i], name="Uncalibrated", ax=axes[i], marker="s" + ) + CalibrationDisplay.from_predictions( + y == c, + ts.predict_proba(X)[:, i], + name="Temperature scaling", + ax=axes[i], + marker="o", + ) + CalibrationDisplay.from_predictions( + y == c, sig.predict_proba(X)[:, i], name="Sigmoid", ax=axes[i], marker="v" + ) + axes[i].set_title(f"Class {c}") + axes[i].set_xlabel(None) + axes[i].set_ylabel(None) + axes[i].get_legend().remove() +fig.suptitle("Reliability Diagrams per Class") +fig.supxlabel("Mean Predicted Probability") +fig.supylabel("Fraction of Class") +fig.legend(*axes[0].get_legend_handles_labels(), loc=(0.72, 0.5)) +plt.subplots_adjust(right=0.7) +_ = fig.show() + +# %% +# Efficiency improvements in linear models +# ---------------------------------------- +# The fit time has been massively reduced for squared error based estimators +# with L1 penalty: `ElasticNet`, `Lasso`, `MultiTaskElasticNet`, +# `MultiTaskLasso` and their CV variants. The fit time improvement is mainly +# achieved by **gap safe screening rules**. They enable the coordinate descent +# solver to set feature coefficients to zero early on and not look at them +# again. The stronger the L1 penalty the earlier features can be excluded from +# further updates. + +from time import time + +from sklearn.datasets import make_regression +from sklearn.linear_model import ElasticNetCV + +X, y = make_regression(n_features=10_000, random_state=0) +model = ElasticNetCV() +tic = time() +model.fit(X, y) +toc = time() +print(f"Fitting ElasticNetCV took {toc - tic:.3} seconds.") + +# %% +# HTML representation of estimators +# --------------------------------- +# Hyperparameters in the dropdown table of the HTML representation now include +# links to the online documentation. Docstring descriptions are also shown as +# tooltips on hover. + +from sklearn.linear_model import LogisticRegression +from sklearn.pipeline import make_pipeline +from sklearn.preprocessing import StandardScaler + +clf = make_pipeline(StandardScaler(), LogisticRegression(random_state=0, C=10)) + +# %% +# Expand the estimator diagram below by clicking on "LogisticRegression" and then on +# "Parameters". + +clf + + +# %% +# DecisionTreeRegressor with `criterion="absolute_error"` +# ------------------------------------------------------ +# :class:`tree.DecisionTreeRegressor` with `criterion="absolute_error"` +# now runs much faster. It has now `O(n * log(n))` complexity compared to +# `O(n**2)` previously, which allows to scale to millions of data points. +# +# As an illustration, on a dataset with 100_000 samples and 1 feature, doing a +# single split takes of the order of 100 ms, compared to ~20 seconds before. + +import time + +from sklearn.datasets import make_regression +from sklearn.tree import DecisionTreeRegressor + +X, y = make_regression(n_samples=100_000, n_features=1) +tree = DecisionTreeRegressor(criterion="absolute_error", max_depth=1) + +tic = time.time() +tree.fit(X, y) +elapsed = time.time() - tic +print(f"Fit took {elapsed:.2f} seconds") + +# %% +# ClassicalMDS +# ------------ +# Classical MDS, also known as "Principal Coordinates Analysis" (PCoA) +# or "Torgerson's scaling" is now available within the `sklearn.manifold` +# module. Classical MDS is close to PCA and instead of approximating +# distances, it approximates pairwise scalar products, which has an exact +# analytic solution in terms of eigendecomposition. +# +# Let's illustrate this new addition by using it on an S-curve dataset to +# get a low-dimensional representation of the data. + +import matplotlib.pyplot as plt +from matplotlib import ticker + +from sklearn import datasets, manifold + +n_samples = 1500 +S_points, S_color = datasets.make_s_curve(n_samples, random_state=0) +md_classical = manifold.ClassicalMDS(n_components=2) +S_scaling = md_classical.fit_transform(S_points) + +fig = plt.figure(figsize=(8, 4)) +ax1 = fig.add_subplot(1, 2, 1, projection="3d") +x, y, z = S_points.T +ax1.scatter(x, y, z, c=S_color, s=50, alpha=0.8) +ax1.set_title("Original S-curve samples", size=16) +ax1.view_init(azim=-60, elev=9) +for axis in (ax1.xaxis, ax1.yaxis, ax1.zaxis): + axis.set_major_locator(ticker.MultipleLocator(1)) + +ax2 = fig.add_subplot(1, 2, 2) +x2, y2 = S_scaling.T +ax2.scatter(x2, y2, c=S_color, s=50, alpha=0.8) +ax2.set_title("Classical MDS", size=16) +for axis in (ax2.xaxis, ax2.yaxis): + axis.set_major_formatter(ticker.NullFormatter()) + +plt.show() From b04ad9520f09982b9093810bc55daacdf250a472 Mon Sep 17 00:00:00 2001 From: Anne Beyer Date: Wed, 10 Dec 2025 00:32:48 +0100 Subject: [PATCH 02/19] MNT Update link to new build instruction location in `raise_build_error` (#32862) --- sklearn/__check_build/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklearn/__check_build/__init__.py b/sklearn/__check_build/__init__.py index 0a4162d0dffc6..f272b008f85b9 100644 --- a/sklearn/__check_build/__init__.py +++ b/sklearn/__check_build/__init__.py @@ -42,7 +42,7 @@ def raise_build_error(e): If you have installed scikit-learn from source, please do not forget to build the package before using it. For detailed instructions, see: -https://scikit-learn.org/dev/developers/advanced_installation.html#building-from-source +https://scikit-learn.org/dev/developers/development_setup.html#install-editable-version-of-scikit-learn %s""" % (e, local_dir, "".join(dir_content).strip(), msg) ) From 9e24cf5666cc4d3247bc6169724431d65a6ad662 Mon Sep 17 00:00:00 2001 From: Anne Beyer Date: Wed, 10 Dec 2025 08:52:52 +0100 Subject: [PATCH 03/19] FIX add quickfix for pandas warning causing CI error (#32865) Co-authored-by: Olivier Grisel --- .../tests/test_target_encoder.py | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/sklearn/preprocessing/tests/test_target_encoder.py b/sklearn/preprocessing/tests/test_target_encoder.py index 536f2e031bf77..84f04ec46f343 100644 --- a/sklearn/preprocessing/tests/test_target_encoder.py +++ b/sklearn/preprocessing/tests/test_target_encoder.py @@ -1,4 +1,5 @@ import re +import warnings import numpy as np import pytest @@ -20,6 +21,7 @@ LabelEncoder, TargetEncoder, ) +from sklearn.utils.fixes import parse_version def _encode_target(X_ordinal, y_numeric, n_categories, smooth): @@ -709,6 +711,25 @@ def test_pandas_copy_on_write(): Non-regression test for gh-27879. """ pd = pytest.importorskip("pandas", minversion="2.0") - with pd.option_context("mode.copy_on_write", True): + # Pandas currently warns that setting copy_on_write will be removed in pandas 4 + # (and copy-on-write will always be enabled). + # see https://github.com/scikit-learn/scikit-learn/issues/32829 + # TODO: remove this workaround when pandas 4 is our minimum version + if parse_version(pd.__version__) >= parse_version("4.0"): df = pd.DataFrame({"x": ["a", "b", "b"], "y": [4.0, 5.0, 6.0]}) TargetEncoder(target_type="continuous").fit(df[["x"]], df["y"]) + else: + with warnings.catch_warnings(): + expected_message = ( + "Copy-on-Write can no longer be disabled, " + "setting to False has no impact. This option will " + "be removed in pandas 4.0." + ) + warnings.filterwarnings( + "ignore", + message=re.escape(expected_message), + category=DeprecationWarning, + ) + with pd.option_context("mode.copy_on_write", True): + df = pd.DataFrame({"x": ["a", "b", "b"], "y": [4.0, 5.0, 6.0]}) + TargetEncoder(target_type="continuous").fit(df[["x"]], df["y"]) From 96df8e88e73592a34e7b89c30db676734595f811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Wed, 10 Dec 2025 09:06:53 +0100 Subject: [PATCH 04/19] DOC Update news for 1.8.0 (#32877) --- doc/templates/index.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/templates/index.html b/doc/templates/index.html index 08abde9895ea0..a7669f9b911b9 100644 --- a/doc/templates/index.html +++ b/doc/templates/index.html @@ -206,15 +206,13 @@

News

    -
  • On-going development: scikit-learn 1.8 (Changelog).
  • +
  • On-going development: scikit-learn 1.9 (Changelog).
  • +
  • December 2025. scikit-learn 1.8.0 is available for download (Changelog).
  • September 2025. scikit-learn 1.7.2 is available for download (Changelog).
  • July 2025. scikit-learn 1.7.1 is available for download (Changelog).
  • June 2025. scikit-learn 1.7.0 is available for download (Changelog).
  • January 2025. scikit-learn 1.6.1 is available for download (Changelog).
  • December 2024. scikit-learn 1.6.0 is available for download (Changelog).
  • -
  • September 2024. scikit-learn 1.5.2 is available for download (Changelog).
  • -
  • July 2024. scikit-learn 1.5.1 is available for download (Changelog).
  • -
  • May 2024. scikit-learn 1.5.0 is available for download (Changelog).
  • All releases: What's new (Changelog).
From 6f7b6c8ca82ede18dd65099c8eaa2b28e1531b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Wed, 10 Dec 2025 10:09:37 +0100 Subject: [PATCH 05/19] DOC Fix too short underline in 1.8 release highlights (#32878) --- examples/release_highlights/plot_release_highlights_1_8_0.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/release_highlights/plot_release_highlights_1_8_0.py b/examples/release_highlights/plot_release_highlights_1_8_0.py index 3414a512724f4..a1d3da07849a6 100644 --- a/examples/release_highlights/plot_release_highlights_1_8_0.py +++ b/examples/release_highlights/plot_release_highlights_1_8_0.py @@ -226,7 +226,7 @@ # %% # DecisionTreeRegressor with `criterion="absolute_error"` -# ------------------------------------------------------ +# ------------------------------------------------------- # :class:`tree.DecisionTreeRegressor` with `criterion="absolute_error"` # now runs much faster. It has now `O(n * log(n))` complexity compared to # `O(n**2)` previously, which allows to scale to millions of data points. From 51df6d60512aabca3af27258ca885f7ffaa4a2a2 Mon Sep 17 00:00:00 2001 From: scikit-learn-bot Date: Wed, 10 Dec 2025 10:42:34 +0100 Subject: [PATCH 06/19] :lock: :robot: CI Update lock files for scipy-dev CI build(s) :lock: :robot: (#32857) Co-authored-by: Lock file bot Co-authored-by: Olivier Grisel --- ...pylatest_pip_scipy_dev_linux-64_conda.lock | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/build_tools/azure/pylatest_pip_scipy_dev_linux-64_conda.lock b/build_tools/azure/pylatest_pip_scipy_dev_linux-64_conda.lock index e5db81f2c3b5e..dcf27d5b939f7 100644 --- a/build_tools/azure/pylatest_pip_scipy_dev_linux-64_conda.lock +++ b/build_tools/azure/pylatest_pip_scipy_dev_linux-64_conda.lock @@ -6,31 +6,31 @@ https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.ta https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda#0539938c55b6b1a59b560e843ad864a4 https://conda.anaconda.org/conda-forge/noarch/tzdata-2025b-h78e105d_0.conda#4222072737ccff51314b5ece9c7d6f5a https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2025.11.12-hbd8a1cb_0.conda#f0991f0f84902f6b6009b4d2350a83aa -https://conda.anaconda.org/conda-forge/linux-64/libgomp-15.2.0-he0feb66_14.conda#91349c276f84f590487e4c7f6e90e077 +https://conda.anaconda.org/conda-forge/linux-64/libgomp-15.2.0-he0feb66_15.conda#a90d6983da0757f4c09bb8fcfaf34e71 https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2#73aaf86a425cc6e73fcf236a5a46396d -https://conda.anaconda.org/conda-forge/linux-64/libgcc-15.2.0-he0feb66_14.conda#550dceb769d23bcf0e2f97fd4062d720 +https://conda.anaconda.org/conda-forge/linux-64/libgcc-15.2.0-he0feb66_15.conda#a5d86b0496174a412d531eac03af9174 https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_8.conda#51a19bba1b8ebfb60df25cde030b7ebc https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.7.3-hecca717_0.conda#8b09ae86839581147ef2e5c5e229d164 https://conda.anaconda.org/conda-forge/linux-64/libffi-3.5.2-h9ec8514_0.conda#35f29eec58405aaf55e01cb470d8c26a -https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-15.2.0-h69a702a_14.conda#6c13aaae36d7514f28bd5544da1a7bb8 -https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-15.2.0-h68bc16d_14.conda#3078a2a9a58566a54e579b41b9e88c84 +https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-15.2.0-h69a702a_15.conda#7b742943660c5173bb6a5c823021c9a0 +https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-15.2.0-h68bc16d_15.conda#356b7358fcd6df32ad50d07cdfadd27d https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.1-hb9d3cd8_2.conda#1a580f7796c7bf6393fddb8bbbde58dc https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-hb9d3cd8_0.conda#c7e925f37e3b40d893459e625f6a53f1 -https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-15.2.0-h934c35e_14.conda#8e96fe9b17d5871b5cf9d312cab832f6 -https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.41.2-he9a06e4_0.conda#80c07c68d2f6870250959dcc95b209d1 +https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-15.2.0-h934c35e_15.conda#fccfb26375ec5e4a2192dee6604b6d02 +https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.41.2-h5347b49_1.conda#41f5c09a211985c3ce642d60721e7c3e https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda#edb0dca6bc32e4f4789199455a1dbeb8 https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-h2d0b736_3.conda#47e340acb35de30501a76c7c799c41d7 https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.0-h26f9b46_0.conda#9ee58d5c534af06558933af3c845a780 -https://conda.anaconda.org/conda-forge/linux-64/libgfortran-15.2.0-h69a702a_14.conda#fa9d91abc5a9db36fa8dcd1b9a602e61 +https://conda.anaconda.org/conda-forge/linux-64/libgfortran-15.2.0-h69a702a_15.conda#7deffdc77cda3d2bbc9c558efa33d3ed https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.51.1-h0c1763c_0.conda#2e1b84d273b01835256e53fd938de355 -https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-15.2.0-hdf11a46_14.conda#9531f671a13eec0597941fa19e489b96 +https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-15.2.0-hdf11a46_15.conda#20a8584ff8677ac9d724345b9d4eb757 https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8c095d6_2.conda#283b96675859b20a825f8fa30f311446 https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_ha0e22de_103.conda#86bc20552bf46075e3d92b67f089172d -https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-h3691f8a_4.conda#af7715829219de9043fcc5575e66d22e +https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_6.conda#4a13eeac0b5c8e5b8ab496e6c4ddd829 https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.45-default_hbd61a6d_104.conda#a6abd2796fc332536735f68ba23f7901 -https://conda.anaconda.org/conda-forge/linux-64/libgfortran-ng-15.2.0-h69a702a_14.conda#ab557953cdcf9c483e1d088e0d8ab238 +https://conda.anaconda.org/conda-forge/linux-64/libgfortran-ng-15.2.0-h69a702a_15.conda#83c3e3937b2715e9919bc1ca27a7f684 https://conda.anaconda.org/conda-forge/linux-64/libhiredis-1.0.2-h2cc385e_0.tar.bz2#b34907d3a81a3cd8095ee83d174c074a -https://conda.anaconda.org/conda-forge/linux-64/python-3.14.0-h32b2ec7_102_cp314.conda#0a19d2cc6eb15881889b0c6fa7d6a78d +https://conda.anaconda.org/conda-forge/linux-64/python-3.14.2-h32b2ec7_100_cp314.conda#1cef1236a05c3a98f68c33ae9425f656 https://conda.anaconda.org/conda-forge/linux-64/ccache-4.11.3-h80c52d3_0.conda#eb517c6a2b960c3ccb6f1db1005f063a https://conda.anaconda.org/conda-forge/noarch/pip-25.3-pyh145f28c_0.conda#bf47878473e5ab9fdb4115735230e191 # pip alabaster @ https://files.pythonhosted.org/packages/7e/b3/6b4067be973ae96ba0d615946e314c5ae35f9f993eca561b356540bb0c2b/alabaster-1.0.0-py3-none-any.whl#sha256=fc6786402dc3fcb2de3cabd5fe455a2db534b371124f1f21de8731783dec828b @@ -44,10 +44,10 @@ https://conda.anaconda.org/conda-forge/noarch/pip-25.3-pyh145f28c_0.conda#bf4787 # pip imagesize @ https://files.pythonhosted.org/packages/ff/62/85c4c919272577931d407be5ba5d71c20f0b616d31a0befe0ae45bb79abd/imagesize-1.4.1-py2.py3-none-any.whl#sha256=0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b # pip iniconfig @ https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl#sha256=f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12 # pip markupsafe @ https://files.pythonhosted.org/packages/41/3c/a36c2450754618e62008bf7435ccb0f88053e07592e6028a34776213d877/markupsafe-3.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl#sha256=457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97 -# pip meson @ https://files.pythonhosted.org/packages/9c/07/b48592d325cb86682829f05216e4efb2dc881762b8f1bafb48b57442307a/meson-1.9.1-py3-none-any.whl#sha256=f824ab770c041a202f532f69e114c971918ed2daff7ea56583d80642564598d0 +# pip meson @ https://files.pythonhosted.org/packages/d7/ab/115470e7c6dcce024e43e2e00986864c56e48c59554bb19f4b02ed72814c/meson-1.9.2-py3-none-any.whl#sha256=1a284dc1912929098a6462401af58dc49ae3f324e94814a38a8f1020cee07cba # pip ninja @ https://files.pythonhosted.org/packages/ed/de/0e6edf44d6a04dabd0318a519125ed0415ce437ad5a1ec9b9be03d9048cf/ninja-1.13.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl#sha256=fb46acf6b93b8dd0322adc3a4945452a4e774b75b91293bafcc7b7f8e6517dfa # pip packaging @ https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl#sha256=29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484 -# pip platformdirs @ https://files.pythonhosted.org/packages/73/cb/ac7874b3e5d58441674fb70742e6c374b28b0c7cb988d37d991cde47166c/platformdirs-4.5.0-py3-none-any.whl#sha256=e578a81bb873cbb89a41fcc904c7ef523cc18284b7e3b3ccf06aca1403b7ebd3 +# pip platformdirs @ https://files.pythonhosted.org/packages/cb/28/3bfe2fa5a7b9c46fe7e13c97bda14c895fb10fa2ebf1d0abb90e0cea7ee1/platformdirs-4.5.1-py3-none-any.whl#sha256=d03afa3963c806a9bed9d5125c8f4cb2fdaf74a55ab60e5d59b3fde758104d31 # pip pluggy @ https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl#sha256=e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746 # pip pygments @ https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl#sha256=86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b # pip roman-numerals @ https://files.pythonhosted.org/packages/82/1d/7356f115a0e5faf8dc59894a3e9fc8b1821ab949163458b0072db0a12a68/roman_numerals-3.1.0-py3-none-any.whl#sha256=842ae5fd12912d62720c9aad8cab706e8c692556d01a38443e051ee6cc158d90 @@ -61,15 +61,15 @@ https://conda.anaconda.org/conda-forge/noarch/pip-25.3-pyh145f28c_0.conda#bf4787 # pip sphinxcontrib-serializinghtml @ https://files.pythonhosted.org/packages/52/a7/d2782e4e3f77c8450f727ba74a8f12756d5ba823d81b941f1b04da9d033a/sphinxcontrib_serializinghtml-2.0.0-py3-none-any.whl#sha256=6e2cb0eef194e10c27ec0023bfeb25badbbb5868244cf5bc5bdc04e4464bf331 # pip tabulate @ https://files.pythonhosted.org/packages/40/44/4a5f08c96eb108af5cb50b41f76142f0afa346dfa99d5296fe7202a11854/tabulate-0.9.0-py3-none-any.whl#sha256=024ca478df22e9340661486f85298cff5f6dcdba14f3813e8830015b9ed1948f # pip threadpoolctl @ https://files.pythonhosted.org/packages/32/d5/f9a850d79b0851d1d4ef6456097579a9005b31fea68726a4ae5f2d82ddd9/threadpoolctl-3.6.0-py3-none-any.whl#sha256=43a0b8fd5a2928500110039e43a5eed8480b918967083ea48dc3ab9f13c4a7fb -# pip urllib3 @ https://files.pythonhosted.org/packages/a7/c2/fe1e52489ae3122415c51f387e221dd0773709bad6c6cdaa599e8a2c5185/urllib3-2.5.0-py3-none-any.whl#sha256=e6b01673c0fa6a13e374b50871808eb3bf7046c4b125b216f6bf1cc604cff0dc +# pip urllib3 @ https://files.pythonhosted.org/packages/56/1a/9ffe814d317c5224166b23e7c47f606d6e473712a2fad0f704ea9b99f246/urllib3-2.6.0-py3-none-any.whl#sha256=c90f7a39f716c572c4e3e58509581ebd83f9b59cced005b7db7ad2d22b0db99f # pip jinja2 @ https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl#sha256=85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67 # pip pyproject-metadata @ https://files.pythonhosted.org/packages/c0/57/e69a1de45ec7a99a707e9f1a5defa035a48de0cae2d8582451c72d2db456/pyproject_metadata-0.10.0-py3-none-any.whl#sha256=b1e439a9f7560f9792ee5975dcf5e89d2510b1fc84a922d7e5d665aa9102d966 -# pip pytest @ https://files.pythonhosted.org/packages/0b/8b/6300fb80f858cda1c51ffa17075df5d846757081d11ab4aa35cef9e6258b/pytest-9.0.1-py3-none-any.whl#sha256=67be0030d194df2dfa7b556f2e56fb3c3315bd5c8822c6951162b92b32ce7dad +# pip pytest @ https://files.pythonhosted.org/packages/3b/ab/b3226f0bd7cdcf710fbede2b3548584366da3b19b5021e74f5bde2a8fa3f/pytest-9.0.2-py3-none-any.whl#sha256=711ffd45bf766d5264d487b917733b453d917afd2b0ad65223959f59089f875b # pip python-dateutil @ https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl#sha256=a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 # pip requests @ https://files.pythonhosted.org/packages/1e/db/4254e3eabe8020b458f1a747140d32277ec7a271daf1d235b70dc0b4e6e3/requests-2.32.5-py3-none-any.whl#sha256=2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6 # pip meson-python @ https://files.pythonhosted.org/packages/28/58/66db620a8a7ccb32633de9f403fe49f1b63c68ca94e5c340ec5cceeb9821/meson_python-0.18.0-py3-none-any.whl#sha256=3b0fe051551cc238f5febb873247c0949cd60ded556efa130aa57021804868e2 # pip pooch @ https://files.pythonhosted.org/packages/a8/87/77cc11c7a9ea9fd05503def69e3d18605852cd0d4b0d3b8f15bbeb3ef1d1/pooch-1.8.2-py3-none-any.whl#sha256=3529a57096f7198778a5ceefd5ac3ef0e4d06a6ddaf9fc2d609b806f25302c47 # pip pytest-cov @ https://files.pythonhosted.org/packages/80/b4/bb7263e12aade3842b938bc5c6958cae79c5ee18992f9b9349019579da0f/pytest_cov-6.3.0-py3-none-any.whl#sha256=440db28156d2468cafc0415b4f8e50856a0d11faefa38f30906048fe490f1749 # pip pytest-xdist @ https://files.pythonhosted.org/packages/ca/31/d4e37e9e550c2b92a9cbc2e4d0b7420a27224968580b5a447f420847c975/pytest_xdist-3.8.0-py3-none-any.whl#sha256=202ca578cfeb7370784a8c33d6d05bc6e13b4f25b5053c30a152269fd10f0b88 -# pip sphinx @ https://files.pythonhosted.org/packages/fe/8b/76e2a1ce12b915399365873eef2b1197da9d032c99e661a71fd7e1490333/sphinx-9.0.0-py3-none-any.whl#sha256=3442bf635d378da2ba4e88aa8496f3a61b2d59ef145aeaf34353ab93fd79f1bf +# pip sphinx @ https://files.pythonhosted.org/packages/c6/3f/4bbd76424c393caead2e1eb89777f575dee5c8653e2d4b6afd7a564f5974/sphinx-9.0.4-py3-none-any.whl#sha256=5bebc595a5e943ea248b99c13814c1c5e10b3ece718976824ffa7959ff95fffb # pip numpydoc @ https://files.pythonhosted.org/packages/6c/45/56d99ba9366476cd8548527667f01869279cedb9e66b28eb4dfb27701679/numpydoc-1.8.0-py3-none-any.whl#sha256=72024c7fd5e17375dec3608a27c03303e8ad00c81292667955c6fea7a3ccf541 From e0ca871b32cb123484630d9687093c49277ec076 Mon Sep 17 00:00:00 2001 From: Olivier Grisel Date: Wed, 10 Dec 2025 10:56:45 +0100 Subject: [PATCH 07/19] FIX missing RNG seeding in `test_sag_regressor` (#32879) --- sklearn/linear_model/tests/test_sag.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sklearn/linear_model/tests/test_sag.py b/sklearn/linear_model/tests/test_sag.py index 575838f8e8497..f6b0405c23168 100644 --- a/sklearn/linear_model/tests/test_sag.py +++ b/sklearn/linear_model/tests/test_sag.py @@ -577,7 +577,13 @@ def test_sag_regressor(seed, csr_container): # simple linear function with noise y = 0.5 * X.ravel() + rng.randn(n_samples, 1).ravel() - clf1 = Ridge(tol=tol, solver="sag", max_iter=max_iter, alpha=alpha * n_samples) + clf1 = Ridge( + tol=tol, + solver="sag", + max_iter=max_iter, + alpha=alpha * n_samples, + random_state=rng, + ) clf2 = clone(clf1) clf1.fit(X, y) clf2.fit(csr_container(X), y) From b59a67d655b1a41b88f14d706ea403f65ca1b9cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Wed, 10 Dec 2025 12:21:04 +0100 Subject: [PATCH 08/19] DOC Backport changelog changes from 1.8.X branch (#32876) --- .../array-api/27113.feature.rst | 3 - .../array-api/27961.feature.rst | 4 - .../array-api/29822.feature.rst | 5 - .../array-api/30562.feature.rst | 2 - .../array-api/30777.feature.rst | 4 - .../array-api/30878.feature.rst | 2 - .../array-api/31580.feature.rst | 2 - .../array-api/32246.feature.rst | 4 - .../array-api/32249.feature.rst | 3 - .../array-api/32270.feature.rst | 2 - .../array-api/32422.feature.rst | 4 - .../array-api/32497.feature.rst | 2 - .../array-api/32582.feature.rst | 3 - .../array-api/32586.feature.rst | 2 - .../array-api/32597.feature.rst | 2 - .../array-api/32600.feature.rst | 2 - .../array-api/32604.feature.rst | 2 - .../array-api/32613.feature.rst | 2 - .../array-api/32619.feature.rst | 2 - .../array-api/32693.feature.rst | 2 - .../upcoming_changes/array-api/32838.fix.rst | 2 - .../custom-top-level/32079.other.rst | 23 - .../many-modules/31775.efficiency.rst | 4 - .../metadata-routing/31898.fix.rst | 3 - .../sklearn.base/31928.feature.rst | 2 - .../sklearn.base/32341.fix.rst | 2 - .../sklearn.calibration/31068.feature.rst | 2 - .../sklearn.cluster/31973.fix.rst | 4 - .../sklearn.cluster/31991.efficiency.rst | 3 - .../sklearn.compose/32188.fix.rst | 3 - .../sklearn.covariance/31987.efficiency.rst | 6 - .../sklearn.covariance/31987.fix.rst | 6 - .../sklearn.covariance/32117.fix.rst | 4 - .../sklearn.decomposition/29310.fix.rst | 3 - .../31987.efficiency.rst | 11 - .../32077.enhancement.rst | 3 - .../32108.feature.rst | 6 - .../sklearn.ensemble/32825.fix.rst | 8 - .../31939.enhancement.rst | 3 - .../31431.efficiency.rst | 3 - .../sklearn.linear_model/29097.api.rst | 7 - .../sklearn.linear_model/31474.api.rst | 6 - .../sklearn.linear_model/31665.efficiency.rst | 4 - .../sklearn.linear_model/31848.efficiency.rst | 3 - .../sklearn.linear_model/31856.fix.rst | 6 - .../sklearn.linear_model/31880.efficiency.rst | 9 - .../sklearn.linear_model/31888.api.rst | 4 - .../31906.enhancement.rst | 9 - .../sklearn.linear_model/31933.fix.rst | 8 - .../sklearn.linear_model/31946.efficiency.rst | 4 - .../sklearn.linear_model/32014.efficiency.rst | 14 - .../sklearn.linear_model/32114.api.rst | 16 - .../sklearn.linear_model/32659.api.rst | 27 - .../sklearn.linear_model/32742.api.rst | 3 - .../sklearn.linear_model/32747.fix.rst | 4 - .../sklearn.manifold/31322.major-feature.rst | 3 - .../sklearn.manifold/32229.feature.rst | 6 - .../sklearn.manifold/32433.feature.rst | 2 - .../sklearn.metrics/28971.feature.rst | 2 - .../sklearn.metrics/30134.feature.rst | 3 - .../sklearn.metrics/30787.fix.rst | 6 - .../sklearn.metrics/31294.api.rst | 2 - .../sklearn.metrics/31406.enhancement.rst | 2 - .../sklearn.metrics/31701.fix.rst | 21 - .../sklearn.metrics/31764.fix.rst | 5 - .../sklearn.metrics/31891.fix.rst | 3 - .../sklearn.metrics/32047.enhancement.rst | 9 - .../sklearn.metrics/32310.api.rst | 3 - .../sklearn.metrics/32313.fix.rst | 5 - .../sklearn.metrics/32356.efficiency.rst | 3 - .../sklearn.metrics/32356.fix.rst | 4 - .../sklearn.metrics/32372.fix.rst | 4 - .../sklearn.metrics/32549.fix.rst | 7 - .../32265.enhancement.rst | 4 - .../sklearn.model_selection/32540.fix.rst | 3 - .../sklearn.multiclass/15504.fix.rst | 3 - .../sklearn.naive_bayes/32497.fix.rst | 3 - .../28043.enhancement.rst | 2 - .../29307.enhancement.rst | 4 - .../31790.enhancement.rst | 3 - .../sklearn.preprocessing/32592.fix.rst | 2 - .../sklearn.semi_supervised/31924.fix.rst | 4 - .../sklearn.tree/30041.fix.rst | 2 - .../sklearn.tree/31036.fix.rst | 3 - .../sklearn.tree/32100.efficiency.rst | 4 - .../sklearn.tree/32100.fix.rst | 6 - .../sklearn.tree/32259.fix.rst | 3 - .../sklearn.tree/32274.fix.rst | 6 - .../sklearn.tree/32280.fix.rst | 4 - .../sklearn.tree/32351.fix.rst | 3 - .../sklearn.utils/31564.enhancement.rst | 5 - .../sklearn.utils/31873.enhancement.rst | 4 - .../sklearn.utils/31951.enhancement.rst | 4 - .../sklearn.utils/31952.efficiency.rst | 5 - .../sklearn.utils/31969.enhancement.rst | 3 - .../sklearn.utils/32258.api.rst | 3 - .../sklearn.utils/32330.fix.rst | 2 - doc/whats_new/v1.8.rst | 673 +++++++++++++++++- 98 files changed, 672 insertions(+), 455 deletions(-) delete mode 100644 doc/whats_new/upcoming_changes/array-api/27113.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/27961.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/29822.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/30562.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/30777.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/30878.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/31580.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/32246.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/32249.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/32270.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/32422.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/32497.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/32582.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/32586.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/32597.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/32600.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/32604.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/32613.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/32619.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/32693.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/array-api/32838.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/custom-top-level/32079.other.rst delete mode 100644 doc/whats_new/upcoming_changes/many-modules/31775.efficiency.rst delete mode 100644 doc/whats_new/upcoming_changes/metadata-routing/31898.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.base/31928.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.base/32341.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.calibration/31068.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.cluster/31973.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.cluster/31991.efficiency.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.compose/32188.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.covariance/31987.efficiency.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.covariance/31987.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.covariance/32117.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.decomposition/29310.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.decomposition/31987.efficiency.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.decomposition/32077.enhancement.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.discriminant_analysis/32108.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.ensemble/32825.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.feature_selection/31939.enhancement.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.gaussian_process/31431.efficiency.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.linear_model/29097.api.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.linear_model/31474.api.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.linear_model/31665.efficiency.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.linear_model/31848.efficiency.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.linear_model/31856.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.linear_model/31880.efficiency.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.linear_model/31888.api.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.linear_model/31906.enhancement.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.linear_model/31933.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.linear_model/31946.efficiency.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.linear_model/32014.efficiency.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.linear_model/32114.api.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.linear_model/32659.api.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.linear_model/32742.api.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.linear_model/32747.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.manifold/31322.major-feature.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.manifold/32229.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.manifold/32433.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.metrics/28971.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.metrics/30134.feature.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.metrics/30787.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.metrics/31294.api.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.metrics/31406.enhancement.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.metrics/31701.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.metrics/31764.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.metrics/31891.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.metrics/32047.enhancement.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.metrics/32310.api.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.metrics/32313.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.metrics/32356.efficiency.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.metrics/32356.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.metrics/32372.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.metrics/32549.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.model_selection/32265.enhancement.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.model_selection/32540.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.multiclass/15504.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.naive_bayes/32497.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.preprocessing/28043.enhancement.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.preprocessing/29307.enhancement.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.preprocessing/31790.enhancement.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.preprocessing/32592.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.semi_supervised/31924.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.tree/30041.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.tree/31036.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.tree/32100.efficiency.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.tree/32100.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.tree/32259.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.tree/32274.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.tree/32280.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.tree/32351.fix.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.utils/31564.enhancement.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.utils/31873.enhancement.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.utils/31951.enhancement.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.utils/31952.efficiency.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.utils/31969.enhancement.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.utils/32258.api.rst delete mode 100644 doc/whats_new/upcoming_changes/sklearn.utils/32330.fix.rst diff --git a/doc/whats_new/upcoming_changes/array-api/27113.feature.rst b/doc/whats_new/upcoming_changes/array-api/27113.feature.rst deleted file mode 100644 index 5e044c82cd568..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/27113.feature.rst +++ /dev/null @@ -1,3 +0,0 @@ -- :class:`sklearn.preprocessing.StandardScaler` now supports Array API compliant inputs. - By :user:`Alexander Fabisch `, :user:`Edoardo Abati `, - :user:`Olivier Grisel ` and :user:`Charles Hill `. diff --git a/doc/whats_new/upcoming_changes/array-api/27961.feature.rst b/doc/whats_new/upcoming_changes/array-api/27961.feature.rst deleted file mode 100644 index 3dbea99e0f749..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/27961.feature.rst +++ /dev/null @@ -1,4 +0,0 @@ -- :class:`linear_model.RidgeCV`, :class:`linear_model.RidgeClassifier` and - :class:`linear_model.RidgeClassifierCV` now support array API compatible - inputs with `solver="svd"`. - By :user:`Jérôme Dockès `. diff --git a/doc/whats_new/upcoming_changes/array-api/29822.feature.rst b/doc/whats_new/upcoming_changes/array-api/29822.feature.rst deleted file mode 100644 index 4cd3dc8d300cb..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/29822.feature.rst +++ /dev/null @@ -1,5 +0,0 @@ -- :func:`metrics.pairwise.pairwise_kernels` for any kernel except - "laplacian" and - :func:`metrics.pairwise_distances` for metrics "cosine", - "euclidean" and "l2" now support array API inputs. - By :user:`Emily Chen ` and :user:`Lucy Liu ` diff --git a/doc/whats_new/upcoming_changes/array-api/30562.feature.rst b/doc/whats_new/upcoming_changes/array-api/30562.feature.rst deleted file mode 100644 index 3c1a58d90bfe5..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/30562.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :func:`sklearn.metrics.confusion_matrix` now supports Array API compatible inputs. - By :user:`Stefanie Senger ` diff --git a/doc/whats_new/upcoming_changes/array-api/30777.feature.rst b/doc/whats_new/upcoming_changes/array-api/30777.feature.rst deleted file mode 100644 index aec9bb4da1e71..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/30777.feature.rst +++ /dev/null @@ -1,4 +0,0 @@ -- :class:`sklearn.mixture.GaussianMixture` with - `init_params="random"` or `init_params="random_from_data"` and - `warm_start=False` now supports Array API compatible inputs. - By :user:`Stefanie Senger ` and :user:`Loïc Estève ` diff --git a/doc/whats_new/upcoming_changes/array-api/30878.feature.rst b/doc/whats_new/upcoming_changes/array-api/30878.feature.rst deleted file mode 100644 index fabb4c80f5713..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/30878.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :func:`sklearn.metrics.roc_curve` now supports Array API compatible inputs. - By :user:`Thomas Li ` diff --git a/doc/whats_new/upcoming_changes/array-api/31580.feature.rst b/doc/whats_new/upcoming_changes/array-api/31580.feature.rst deleted file mode 100644 index 3d7aaa4372109..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/31580.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :class:`preprocessing.PolynomialFeatures` now supports array API compatible inputs. - By :user:`Omar Salman ` diff --git a/doc/whats_new/upcoming_changes/array-api/32246.feature.rst b/doc/whats_new/upcoming_changes/array-api/32246.feature.rst deleted file mode 100644 index aaf015fd3ff79..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/32246.feature.rst +++ /dev/null @@ -1,4 +0,0 @@ -- :class:`calibration.CalibratedClassifierCV` now supports array API compatible - inputs with `method="temperature"` and when the underlying `estimator` also - supports the array API. - By :user:`Omar Salman ` diff --git a/doc/whats_new/upcoming_changes/array-api/32249.feature.rst b/doc/whats_new/upcoming_changes/array-api/32249.feature.rst deleted file mode 100644 index f8102a540328f..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/32249.feature.rst +++ /dev/null @@ -1,3 +0,0 @@ -- :func:`sklearn.metrics.precision_recall_curve` now supports array API compatible - inputs. - By :user:`Lucy Liu ` diff --git a/doc/whats_new/upcoming_changes/array-api/32270.feature.rst b/doc/whats_new/upcoming_changes/array-api/32270.feature.rst deleted file mode 100644 index 1b2e4ce05090d..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/32270.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :func:`sklearn.model_selection.cross_val_predict` now supports array API compatible inputs. - By :user:`Omar Salman ` diff --git a/doc/whats_new/upcoming_changes/array-api/32422.feature.rst b/doc/whats_new/upcoming_changes/array-api/32422.feature.rst deleted file mode 100644 index fa0cfe503d7f7..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/32422.feature.rst +++ /dev/null @@ -1,4 +0,0 @@ -- :func:`sklearn.metrics.brier_score_loss`, :func:`sklearn.metrics.log_loss`, - :func:`sklearn.metrics.d2_brier_score` and :func:`sklearn.metrics.d2_log_loss_score` - now support array API compatible inputs. - By :user:`Omar Salman ` diff --git a/doc/whats_new/upcoming_changes/array-api/32497.feature.rst b/doc/whats_new/upcoming_changes/array-api/32497.feature.rst deleted file mode 100644 index 1b02c72f043af..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/32497.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :class:`naive_bayes.GaussianNB` now supports array API compatible inputs. - By :user:`Omar Salman ` diff --git a/doc/whats_new/upcoming_changes/array-api/32582.feature.rst b/doc/whats_new/upcoming_changes/array-api/32582.feature.rst deleted file mode 100644 index b3fefc594483b..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/32582.feature.rst +++ /dev/null @@ -1,3 +0,0 @@ -- :class:`preprocessing.LabelBinarizer` and :func:`preprocessing.label_binarize` now - support numeric array API compatible inputs with `sparse_output=False`. - By :user:`Virgil Chan `. diff --git a/doc/whats_new/upcoming_changes/array-api/32586.feature.rst b/doc/whats_new/upcoming_changes/array-api/32586.feature.rst deleted file mode 100644 index 8770a2422140b..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/32586.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :func:`sklearn.metrics.det_curve` now supports Array API compliant inputs. - By :user:`Josef Affourtit `. diff --git a/doc/whats_new/upcoming_changes/array-api/32597.feature.rst b/doc/whats_new/upcoming_changes/array-api/32597.feature.rst deleted file mode 100644 index 2d22190b4a052..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/32597.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :func:`sklearn.metrics.pairwise.manhattan_distances` now supports array API compatible inputs. - By :user:`Omar Salman `. diff --git a/doc/whats_new/upcoming_changes/array-api/32600.feature.rst b/doc/whats_new/upcoming_changes/array-api/32600.feature.rst deleted file mode 100644 index f39aa06a6cb70..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/32600.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :func:`sklearn.metrics.calinski_harabasz_score` now supports Array API compliant inputs. - By :user:`Josef Affourtit `. diff --git a/doc/whats_new/upcoming_changes/array-api/32604.feature.rst b/doc/whats_new/upcoming_changes/array-api/32604.feature.rst deleted file mode 100644 index 752ea5b9cb3b5..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/32604.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :func:`sklearn.metrics.balanced_accuracy_score` now supports array API compatible inputs. - By :user:`Omar Salman `. diff --git a/doc/whats_new/upcoming_changes/array-api/32613.feature.rst b/doc/whats_new/upcoming_changes/array-api/32613.feature.rst deleted file mode 100644 index 34c73b653f475..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/32613.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :func:`sklearn.metrics.pairwise.laplacian_kernel` now supports array API compatible inputs. - By :user:`Zubair Shakoor `. diff --git a/doc/whats_new/upcoming_changes/array-api/32619.feature.rst b/doc/whats_new/upcoming_changes/array-api/32619.feature.rst deleted file mode 100644 index ba3928cea8bce..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/32619.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :func:`sklearn.metrics.cohen_kappa_score` now supports array API compatible inputs. - By :user:`Omar Salman `. diff --git a/doc/whats_new/upcoming_changes/array-api/32693.feature.rst b/doc/whats_new/upcoming_changes/array-api/32693.feature.rst deleted file mode 100644 index 466ae99f4e360..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/32693.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :func:`sklearn.metrics.cluster.davies_bouldin_score` now supports Array API compliant inputs. - By :user:`Josef Affourtit `. diff --git a/doc/whats_new/upcoming_changes/array-api/32838.fix.rst b/doc/whats_new/upcoming_changes/array-api/32838.fix.rst deleted file mode 100644 index ae689f8816841..0000000000000 --- a/doc/whats_new/upcoming_changes/array-api/32838.fix.rst +++ /dev/null @@ -1,2 +0,0 @@ -- Estimators with array API support no longer reject dataframe inputs when array API support is enabled. - By :user:`Tim Head ` diff --git a/doc/whats_new/upcoming_changes/custom-top-level/32079.other.rst b/doc/whats_new/upcoming_changes/custom-top-level/32079.other.rst deleted file mode 100644 index 0ac966843c075..0000000000000 --- a/doc/whats_new/upcoming_changes/custom-top-level/32079.other.rst +++ /dev/null @@ -1,23 +0,0 @@ -Free-threaded CPython 3.14 support ----------------------------------- - -scikit-learn has support for free-threaded CPython, in particular -free-threaded wheels are available for all of our supported platforms on Python -3.14. - -Free-threaded (also known as nogil) CPython is a version of CPython that aims at -enabling efficient multi-threaded use cases by removing the Global Interpreter -Lock (GIL). - -If you want to try out free-threaded Python, the recommendation is to use -Python 3.14, that has fixed a number of issues compared to Python 3.13. Feel -free to try free-threaded on your use case and report any issues! - -For more details about free-threaded CPython see `py-free-threading doc `_, -in particular `how to install a free-threaded CPython `_ -and `Ecosystem compatibility tracking `_. - -By :user:`Loïc Estève ` and :user:`Olivier Grisel ` and many -other people in the wider Scientific Python and CPython ecosystem, for example -:user:`Nathan Goldbaum `, :user:`Ralf Gommers `, -:user:`Edgar Andrés Margffoy Tuay `. diff --git a/doc/whats_new/upcoming_changes/many-modules/31775.efficiency.rst b/doc/whats_new/upcoming_changes/many-modules/31775.efficiency.rst deleted file mode 100644 index 5aa067aeeb7cf..0000000000000 --- a/doc/whats_new/upcoming_changes/many-modules/31775.efficiency.rst +++ /dev/null @@ -1,4 +0,0 @@ -- Improved CPU and memory usage in estimators and metric functions that rely on - weighted percentiles and better match NumPy and Scipy (un-weighted) implementations - of percentiles. - By :user:`Lucy Liu ` diff --git a/doc/whats_new/upcoming_changes/metadata-routing/31898.fix.rst b/doc/whats_new/upcoming_changes/metadata-routing/31898.fix.rst deleted file mode 100644 index bb4b71974ca60..0000000000000 --- a/doc/whats_new/upcoming_changes/metadata-routing/31898.fix.rst +++ /dev/null @@ -1,3 +0,0 @@ -- Fixed an issue where passing `sample_weight` to a :class:`Pipeline` inside a - :class:`GridSearchCV` would raise an error with metadata routing enabled. - By `Adrin Jalali`_. diff --git a/doc/whats_new/upcoming_changes/sklearn.base/31928.feature.rst b/doc/whats_new/upcoming_changes/sklearn.base/31928.feature.rst deleted file mode 100644 index 65b94b580f3de..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.base/31928.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -- Refactored :meth:`dir` in :class:`BaseEstimator` to recognize condition check in :meth:`available_if`. - By :user:`John Hendricks ` and :user:`Miguel Parece `. diff --git a/doc/whats_new/upcoming_changes/sklearn.base/32341.fix.rst b/doc/whats_new/upcoming_changes/sklearn.base/32341.fix.rst deleted file mode 100644 index 0c43b4cfac930..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.base/32341.fix.rst +++ /dev/null @@ -1,2 +0,0 @@ -- Fixed the handling of pandas missing values in HTML display of all estimators. - By :user:`Dea María Léon `. diff --git a/doc/whats_new/upcoming_changes/sklearn.calibration/31068.feature.rst b/doc/whats_new/upcoming_changes/sklearn.calibration/31068.feature.rst deleted file mode 100644 index 4201db9ad0e59..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.calibration/31068.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -- Added temperature scaling method in :class:`calibration.CalibratedClassifierCV`. - By :user:`Virgil Chan ` and :user:`Christian Lorentzen `. diff --git a/doc/whats_new/upcoming_changes/sklearn.cluster/31973.fix.rst b/doc/whats_new/upcoming_changes/sklearn.cluster/31973.fix.rst deleted file mode 100644 index f04abbb889f7d..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.cluster/31973.fix.rst +++ /dev/null @@ -1,4 +0,0 @@ -- The default value of the `copy` parameter in :class:`cluster.HDBSCAN` - will change from `False` to `True` in 1.10 to avoid data modification - and maintain consistency with other estimators. - By :user:`Sarthak Puri `. \ No newline at end of file diff --git a/doc/whats_new/upcoming_changes/sklearn.cluster/31991.efficiency.rst b/doc/whats_new/upcoming_changes/sklearn.cluster/31991.efficiency.rst deleted file mode 100644 index 955b8b9ef4c14..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.cluster/31991.efficiency.rst +++ /dev/null @@ -1,3 +0,0 @@ -- :func:`cluster.kmeans_plusplus` now uses `np.cumsum` directly without extra - numerical stability checks and without casting to `np.float64`. - By :user:`Tiziano Zito ` diff --git a/doc/whats_new/upcoming_changes/sklearn.compose/32188.fix.rst b/doc/whats_new/upcoming_changes/sklearn.compose/32188.fix.rst deleted file mode 100644 index 1bd73934a426c..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.compose/32188.fix.rst +++ /dev/null @@ -1,3 +0,0 @@ -- The :class:`compose.ColumnTransformer` now correctly fits on data provided as a - `polars.DataFrame` when any transformer has a sparse output. - By :user:`Phillipp Gnan `. diff --git a/doc/whats_new/upcoming_changes/sklearn.covariance/31987.efficiency.rst b/doc/whats_new/upcoming_changes/sklearn.covariance/31987.efficiency.rst deleted file mode 100644 index a05849fd84ad8..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.covariance/31987.efficiency.rst +++ /dev/null @@ -1,6 +0,0 @@ -- :class:`sklearn.covariance.GraphicalLasso`, - :class:`sklearn.covariance.GraphicalLassoCV` and - :func:`sklearn.covariance.graphical_lasso` with `mode="cd"` profit from the - fit time performance improvement of :class:`sklearn.linear_model.Lasso` by means of - gap safe screening rules. - By :user:`Christian Lorentzen `. diff --git a/doc/whats_new/upcoming_changes/sklearn.covariance/31987.fix.rst b/doc/whats_new/upcoming_changes/sklearn.covariance/31987.fix.rst deleted file mode 100644 index 1728c7f9ead6e..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.covariance/31987.fix.rst +++ /dev/null @@ -1,6 +0,0 @@ -- Fixed uncontrollable randomness in :class:`sklearn.covariance.GraphicalLasso`, - :class:`sklearn.covariance.GraphicalLassoCV` and - :func:`sklearn.covariance.graphical_lasso`. For `mode="cd"`, they now use cyclic - coordinate descent. Before, it was random coordinate descent with uncontrollable - random number seeding. - By :user:`Christian Lorentzen `. diff --git a/doc/whats_new/upcoming_changes/sklearn.covariance/32117.fix.rst b/doc/whats_new/upcoming_changes/sklearn.covariance/32117.fix.rst deleted file mode 100644 index fb8145e22e5ed..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.covariance/32117.fix.rst +++ /dev/null @@ -1,4 +0,0 @@ -- Added correction to :class:`covariance.MinCovDet` to adjust for - consistency at the normal distribution. This reduces the bias present - when applying this method to data that is normally distributed. - By :user:`Daniel Herrera-Esposito ` diff --git a/doc/whats_new/upcoming_changes/sklearn.decomposition/29310.fix.rst b/doc/whats_new/upcoming_changes/sklearn.decomposition/29310.fix.rst deleted file mode 100644 index a6ff94cdac6ab..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.decomposition/29310.fix.rst +++ /dev/null @@ -1,3 +0,0 @@ -- Add input checks to the `inverse_transform` method of :class:`decomposition.PCA` - and :class:`decomposition.IncrementalPCA`. - :pr:`29310` by :user:`Ian Faust `. diff --git a/doc/whats_new/upcoming_changes/sklearn.decomposition/31987.efficiency.rst b/doc/whats_new/upcoming_changes/sklearn.decomposition/31987.efficiency.rst deleted file mode 100644 index 8edfdfcb74d31..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.decomposition/31987.efficiency.rst +++ /dev/null @@ -1,11 +0,0 @@ -- :class:`sklearn.decomposition.DictionaryLearning` and - :class:`sklearn.decomposition.MiniBatchDictionaryLearning` with `fit_algorithm="cd"`, - :class:`sklearn.decomposition.SparseCoder` with `transform_algorithm="lasso_cd"`, - :class:`sklearn.decomposition.MiniBatchSparsePCA`, - :class:`sklearn.decomposition.SparsePCA`, - :func:`sklearn.decomposition.dict_learning` and - :func:`sklearn.decomposition.dict_learning_online` with `method="cd"`, - :func:`sklearn.decomposition.sparse_encode` with `algorithm="lasso_cd"` - all profit from the fit time performance improvement of - :class:`sklearn.linear_model.Lasso` by means of gap safe screening rules. - By :user:`Christian Lorentzen `. diff --git a/doc/whats_new/upcoming_changes/sklearn.decomposition/32077.enhancement.rst b/doc/whats_new/upcoming_changes/sklearn.decomposition/32077.enhancement.rst deleted file mode 100644 index aacff8ae1b76c..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.decomposition/32077.enhancement.rst +++ /dev/null @@ -1,3 +0,0 @@ -- :class:`decomposition.SparseCoder` now follows the transformer API of scikit-learn. - In addition, the :meth:`fit` method now validates the input and parameters. - By :user:`François Paugam `. diff --git a/doc/whats_new/upcoming_changes/sklearn.discriminant_analysis/32108.feature.rst b/doc/whats_new/upcoming_changes/sklearn.discriminant_analysis/32108.feature.rst deleted file mode 100644 index 1379a834c63a4..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.discriminant_analysis/32108.feature.rst +++ /dev/null @@ -1,6 +0,0 @@ -- Added `solver`, `covariance_estimator` and `shrinkage` in - :class:`discriminant_analysis.QuadraticDiscriminantAnalysis`. - The resulting class is more similar to - :class:`discriminant_analysis.LinearDiscriminantAnalysis` - and allows for more flexibility in the estimation of the covariance matrices. - By :user:`Daniel Herrera-Esposito `. diff --git a/doc/whats_new/upcoming_changes/sklearn.ensemble/32825.fix.rst b/doc/whats_new/upcoming_changes/sklearn.ensemble/32825.fix.rst deleted file mode 100644 index 604ec9421a424..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.ensemble/32825.fix.rst +++ /dev/null @@ -1,8 +0,0 @@ -- :class:`ensemble.BaggingClassifier`, :class:`ensemble.BaggingRegressor` and - :class:`ensemble.IsolationForest` now use `sample_weight` to draw the samples - instead of forwarding them multiplied by a uniformly sampled mask to the - underlying estimators. Furthermore, when `max_samples` is a float, it is now - interpreted as a fraction of `sample_weight.sum()` instead of `X.shape[0]`. - The new default `max_samples=None` draws `X.shape[0]` samples, irrespective - of `sample_weight`. - By :user:`Antoine Baker `. :pr:`31414` and diff --git a/doc/whats_new/upcoming_changes/sklearn.feature_selection/31939.enhancement.rst b/doc/whats_new/upcoming_changes/sklearn.feature_selection/31939.enhancement.rst deleted file mode 100644 index 8c038c35389ed..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.feature_selection/31939.enhancement.rst +++ /dev/null @@ -1,3 +0,0 @@ -- :class:`feature_selection.SelectFromModel` now does not force `max_features` to be - less than or equal to the number of input features. - By :user:`Thibault ` diff --git a/doc/whats_new/upcoming_changes/sklearn.gaussian_process/31431.efficiency.rst b/doc/whats_new/upcoming_changes/sklearn.gaussian_process/31431.efficiency.rst deleted file mode 100644 index 798f2ebb6bd2f..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.gaussian_process/31431.efficiency.rst +++ /dev/null @@ -1,3 +0,0 @@ -- make :class:`GaussianProcessRegressor.predict` faster when `return_cov` and - `return_std` are both `False`. - By :user:`Rafael Ayllón Gavilán `. diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/29097.api.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/29097.api.rst deleted file mode 100644 index 8cb6265a607a5..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.linear_model/29097.api.rst +++ /dev/null @@ -1,7 +0,0 @@ -- :class:`linear_model.PassiveAggressiveClassifier` and - :class:`linear_model.PassiveAggressiveRegressor` are deprecated and will be removed - in 1.10. Equivalent estimators are available with :class:`linear_model.SGDClassifier` - and :class:`SGDRegressor`, both of which expose the options `learning_rate="pa1"` and - `"pa2"`. The parameter `eta0` can be used to specify the aggressiveness parameter of - the Passive-Aggressive-Algorithms, called C in the reference paper. - By :user:`Christian Lorentzen ` :pr:`31932` and diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/31474.api.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/31474.api.rst deleted file mode 100644 index 845b9b502b9f1..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.linear_model/31474.api.rst +++ /dev/null @@ -1,6 +0,0 @@ -- :class:`linear_model.SGDClassifier`, :class:`linear_model.SGDRegressor`, and - :class:`linear_model.SGDOneClassSVM` now deprecate negative values for the - `power_t` parameter. Using a negative value will raise a warning in version 1.8 - and will raise an error in version 1.10. A value in the range [0.0, inf) must be used - instead. - By :user:`Ritvi Alagusankar ` \ No newline at end of file diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/31665.efficiency.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/31665.efficiency.rst deleted file mode 100644 index 24a8d53f80b23..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.linear_model/31665.efficiency.rst +++ /dev/null @@ -1,4 +0,0 @@ -- :class:`linear_model.ElasticNet` and :class:`linear_model.Lasso` with - `precompute=False` use less memory for dense `X` and are a bit faster. - Previously, they used twice the memory of `X` even for Fortran-contiguous `X`. - By :user:`Christian Lorentzen ` diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/31848.efficiency.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/31848.efficiency.rst deleted file mode 100644 index b76b7cacc8328..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.linear_model/31848.efficiency.rst +++ /dev/null @@ -1,3 +0,0 @@ -- :class:`linear_model.ElasticNet` and :class:`linear_model.Lasso` avoid - double input checking and are therefore a bit faster. - By :user:`Christian Lorentzen `. diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/31856.fix.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/31856.fix.rst deleted file mode 100644 index 8d9138d2b449a..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.linear_model/31856.fix.rst +++ /dev/null @@ -1,6 +0,0 @@ -- Fix the convergence criteria for SGD models, to avoid premature convergence when - `tol != None`. This primarily impacts :class:`SGDOneClassSVM` but also affects - :class:`SGDClassifier` and :class:`SGDRegressor`. Before this fix, only the loss - function without penalty was used as the convergence check, whereas now, the full - objective with regularization is used. - By :user:`Guillaume Lemaitre ` and :user:`kostayScr ` diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/31880.efficiency.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/31880.efficiency.rst deleted file mode 100644 index 195eb42d907eb..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.linear_model/31880.efficiency.rst +++ /dev/null @@ -1,9 +0,0 @@ -- :class:`linear_model.ElasticNet`, :class:`linear_model.ElasticNetCV`, - :class:`linear_model.Lasso`, :class:`linear_model.LassoCV`, - :class:`linear_model.MultiTaskElasticNet`, - :class:`linear_model.MultiTaskElasticNetCV`, - :class:`linear_model.MultiTaskLasso` and :class:`linear_model.MultiTaskLassoCV` - are faster to fit by avoiding a BLAS level 1 (axpy) call in the innermost loop. - Same for functions :func:`linear_model.enet_path` and - :func:`linear_model.lasso_path`. - By :user:`Christian Lorentzen ` :pr:`31956` and diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/31888.api.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/31888.api.rst deleted file mode 100644 index a1ac21999bb09..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.linear_model/31888.api.rst +++ /dev/null @@ -1,4 +0,0 @@ -- Raising error in :class:`sklearn.linear_model.LogisticRegression` when - liblinear solver is used and input X values are larger than 1e30, - the liblinear solver freezes otherwise. - By :user:`Shruti Nath `. diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/31906.enhancement.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/31906.enhancement.rst deleted file mode 100644 index 8417c3dd2ac29..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.linear_model/31906.enhancement.rst +++ /dev/null @@ -1,9 +0,0 @@ -- :class:`linear_model.ElasticNet`, :class:`linear_model.ElasticNetCV`, - :class:`linear_model.Lasso`, :class:`linear_model.LassoCV`, - :class:`MultiTaskElasticNet`, :class:`MultiTaskElasticNetCV`, - :class:`MultiTaskLasso`, :class:`MultiTaskLassoCV`, as well as - :func:`linear_model.enet_path` and :func:`linear_model.lasso_path` - now use `dual gap <= tol` instead of `dual gap < tol` as stopping criterion. - The resulting coefficients might differ to previous versions of scikit-learn in - rare cases. - By :user:`Christian Lorentzen `. diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/31933.fix.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/31933.fix.rst deleted file mode 100644 index b4995b3908c35..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.linear_model/31933.fix.rst +++ /dev/null @@ -1,8 +0,0 @@ -- The allowed parameter range for the initial learning rate `eta0` in - :class:`linear_model.SGDClassifier`, :class:`linear_model.SGDOneClassSVM`, - :class:`linear_model.SGDRegressor` and :class:`linear_model.Perceptron` - changed from non-negative numbers to strictly positive numbers. - As a consequence, the default `eta0` of :class:`linear_model.SGDClassifier` - and :class:`linear_model.SGDOneClassSVM` changed from 0 to 0.01. But note that - `eta0` is not used by the default learning rate "optimal" of those two estimators. - By :user:`Christian Lorentzen `. diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/31946.efficiency.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/31946.efficiency.rst deleted file mode 100644 index 0a4fc0bccf2a6..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.linear_model/31946.efficiency.rst +++ /dev/null @@ -1,4 +0,0 @@ -- :class:`linear_model.ElasticNetCV`, :class:`linear_model.LassoCV`, - :class:`linear_model.MultiTaskElasticNetCV` and :class:`linear_model.MultiTaskLassoCV` - avoid an additional copy of `X` with default `copy_X=True`. - By :user:`Christian Lorentzen `. diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/32014.efficiency.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/32014.efficiency.rst deleted file mode 100644 index 6bb68b2c68c12..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.linear_model/32014.efficiency.rst +++ /dev/null @@ -1,14 +0,0 @@ -- :class:`linear_model.ElasticNet`, :class:`linear_model.ElasticNetCV`, - :class:`linear_model.Lasso`, :class:`linear_model.LassoCV`, - :class:`linear_model.MultiTaskElasticNet`, :class:`linear_model.MultiTaskElasticNetCV` - :class:`linear_model.MultiTaskLasso`, :class:`linear_model.MultiTaskLassoCV` - as well as - :func:`linear_model.lasso_path` and :func:`linear_model.enet_path` now implement - gap safe screening rules in the coordinate descent solver for dense and sparse `X`. - The speedup of fitting time is particularly pronounced (10-times is possible) when - computing regularization paths like the \*CV-variants of the above estimators do. - There is now an additional check of the stopping criterion before entering the main - loop of descent steps. As the stopping criterion requires the computation of the dual - gap, the screening happens whenever the dual gap is computed. - By :user:`Christian Lorentzen ` :pr:`31882`, :pr:`31986`, - :pr:`31987` and diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/32114.api.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/32114.api.rst deleted file mode 100644 index 7b6768464cf81..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.linear_model/32114.api.rst +++ /dev/null @@ -1,16 +0,0 @@ -- :class:`linear_model.LogisticRegressionCV` got a new parameter - `use_legacy_attributes` to control the types and shapes of the fitted attributes - `C_`, `l1_ratio_`, `coefs_paths_`, `scores_` and `n_iter_`. - The current default value `True` keeps the legacy behaviour. If `False` then: - - - ``C_`` is a float. - - ``l1_ratio_`` is a float. - - ``coefs_paths_`` is an ndarray of shape - (n_folds, n_l1_ratios, n_cs, n_classes, n_features). - For binary problems (n_classes=2), the 2nd last dimension is 1. - - ``scores_`` is an ndarray of shape (n_folds, n_l1_ratios, n_cs). - - ``n_iter_`` is an ndarray of shape (n_folds, n_l1_ratios, n_cs). - - In version 1.10, the default will change to `False` and `use_legacy_attributes` will - be deprecated. In 1.12 `use_legacy_attributes` will be removed. - By :user:`Christian Lorentzen `. diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/32659.api.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/32659.api.rst deleted file mode 100644 index 00b3cd23a7de3..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.linear_model/32659.api.rst +++ /dev/null @@ -1,27 +0,0 @@ -- Parameter `penalty` of :class:`linear_model.LogisticRegression` and - :class:`linear_model.LogisticRegressionCV` is deprecated and will be removed in - version 1.10. The equivalent behaviour can be obtained as follows: - - - for :class:`linear_model.LogisticRegression` - - - use `l1_ratio=0` instead of `penalty="l2"` - - use `l1_ratio=1` instead of `penalty="l1"` - - use `0`. diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/32742.api.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/32742.api.rst deleted file mode 100644 index 0fd15ccf7371e..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.linear_model/32742.api.rst +++ /dev/null @@ -1,3 +0,0 @@ -- The `n_jobs` parameter of :class:`linear_model.LogisticRegression` is deprecated and - will be removed in 1.10. It has no effect since 1.8. - By :user:`Loïc Estève `. diff --git a/doc/whats_new/upcoming_changes/sklearn.linear_model/32747.fix.rst b/doc/whats_new/upcoming_changes/sklearn.linear_model/32747.fix.rst deleted file mode 100644 index 1f83d78aa24de..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.linear_model/32747.fix.rst +++ /dev/null @@ -1,4 +0,0 @@ -- :class:`linear_model.LogisticRegressionCV` is able to handle CV splits where - some class labels are missing in some folds. Before, it raised an error whenever a - class label were missing in a fold. - By :user:`Christian Lorentzen `. diff --git a/doc/whats_new/upcoming_changes/sklearn.manifold/31322.major-feature.rst b/doc/whats_new/upcoming_changes/sklearn.manifold/31322.major-feature.rst deleted file mode 100644 index 0d1610d69747f..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.manifold/31322.major-feature.rst +++ /dev/null @@ -1,3 +0,0 @@ -- :class:`manifold.ClassicalMDS` was implemented to perform classical MDS - (eigendecomposition of the double-centered distance matrix). - By :user:`Dmitry Kobak ` and :user:`Meekail Zain ` diff --git a/doc/whats_new/upcoming_changes/sklearn.manifold/32229.feature.rst b/doc/whats_new/upcoming_changes/sklearn.manifold/32229.feature.rst deleted file mode 100644 index b1af155f5a1c3..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.manifold/32229.feature.rst +++ /dev/null @@ -1,6 +0,0 @@ -- :class:`manifold.MDS` now supports arbitrary distance metrics - (via `metric` and `metric_params` parameters) and - initialization via classical MDS (via `init` parameter). - The `dissimilarity` parameter was deprecated. The old `metric` parameter - was renamed into `metric_mds`. - By :user:`Dmitry Kobak ` diff --git a/doc/whats_new/upcoming_changes/sklearn.manifold/32433.feature.rst b/doc/whats_new/upcoming_changes/sklearn.manifold/32433.feature.rst deleted file mode 100644 index 6a65dd1ad56d9..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.manifold/32433.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :class:`manifold.TSNE` now supports PCA initialization with sparse input matrices. - By :user:`Arturo Amor `. diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/28971.feature.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/28971.feature.rst deleted file mode 100644 index 9a2379bc31114..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.metrics/28971.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :func:`metrics.d2_brier_score` has been added which calculates the D^2 for the Brier score. - By :user:`Omar Salman `. diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/30134.feature.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/30134.feature.rst deleted file mode 100644 index 09f0c99501395..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.metrics/30134.feature.rst +++ /dev/null @@ -1,3 +0,0 @@ -- Add :func:`metrics.confusion_matrix_at_thresholds` function that returns the number of - true negatives, false positives, false negatives and true positives per threshold. - By :user:`Success Moses `. diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/30787.fix.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/30787.fix.rst deleted file mode 100644 index 13edbdfc7874d..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.metrics/30787.fix.rst +++ /dev/null @@ -1,6 +0,0 @@ -- :func:`metrics.median_absolute_error` now uses `_averaged_weighted_percentile` - instead of `_weighted_percentile` to calculate median when `sample_weight` is not - `None`. This is equivalent to using the "averaged_inverted_cdf" instead of - the "inverted_cdf" quantile method, which gives results equivalent to `numpy.median` - if equal weights used. - By :user:`Lucy Liu ` diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/31294.api.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/31294.api.rst deleted file mode 100644 index d5afd1d46e6e0..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.metrics/31294.api.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :func:`metrics.cluster.entropy` is deprecated and will be removed in v1.10. - By :user:`Lucy Liu ` diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/31406.enhancement.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/31406.enhancement.rst deleted file mode 100644 index 4736c67c80132..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.metrics/31406.enhancement.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :func:`metrics.median_absolute_error` now supports Array API compatible inputs. - By :user:`Lucy Liu `. diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/31701.fix.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/31701.fix.rst deleted file mode 100644 index 646cdb544f496..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.metrics/31701.fix.rst +++ /dev/null @@ -1,21 +0,0 @@ -- Additional `sample_weight` checking has been added to - :func:`metrics.accuracy_score`, - :func:`metrics.balanced_accuracy_score`, - :func:`metrics.brier_score_loss`, - :func:`metrics.class_likelihood_ratios`, - :func:`metrics.classification_report`, - :func:`metrics.cohen_kappa_score`, - :func:`metrics.confusion_matrix`, - :func:`metrics.f1_score`, - :func:`metrics.fbeta_score`, - :func:`metrics.hamming_loss`, - :func:`metrics.jaccard_score`, - :func:`metrics.matthews_corrcoef`, - :func:`metrics.multilabel_confusion_matrix`, - :func:`metrics.precision_recall_fscore_support`, - :func:`metrics.precision_score`, - :func:`metrics.recall_score` and - :func:`metrics.zero_one_loss`. - `sample_weight` can only be 1D, consistent to `y_true` and `y_pred` in length,and - all values must be finite and not complex. - By :user:`Lucy Liu `. diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/31764.fix.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/31764.fix.rst deleted file mode 100644 index 8dab2fc772563..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.metrics/31764.fix.rst +++ /dev/null @@ -1,5 +0,0 @@ -- `y_pred` is deprecated in favour of `y_score` in - :func:`metrics.DetCurveDisplay.from_predictions` and - :func:`metrics.PrecisionRecallDisplay.from_predictions`. `y_pred` will be removed in - v1.10. - By :user:`Luis ` diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/31891.fix.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/31891.fix.rst deleted file mode 100644 index f1f280859a1e5..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.metrics/31891.fix.rst +++ /dev/null @@ -1,3 +0,0 @@ -- `repr` on a scorer which has been created with a `partial` `score_func` now correctly - works and uses the `repr` of the given `partial` object. - By `Adrin Jalali`_. diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/32047.enhancement.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/32047.enhancement.rst deleted file mode 100644 index 7fcad9a062ce7..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.metrics/32047.enhancement.rst +++ /dev/null @@ -1,9 +0,0 @@ -- Improved the error message for sparse inputs for the following metrics: - :func:`metrics.accuracy_score`, - :func:`metrics.multilabel_confusion_matrix`, :func:`metrics.jaccard_score`, - :func:`metrics.zero_one_loss`, :func:`metrics.f1_score`, - :func:`metrics.fbeta_score`, :func:`metrics.precision_recall_fscore_support`, - :func:`metrics.class_likelihood_ratios`, :func:`metrics.precision_score`, - :func:`metrics.recall_score`, :func:`metrics.classification_report`, - :func:`metrics.hamming_loss`. - By :user:`Lucy Liu `. diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/32310.api.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/32310.api.rst deleted file mode 100644 index ae7fc385b3bcc..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.metrics/32310.api.rst +++ /dev/null @@ -1,3 +0,0 @@ -- The `estimator_name` parameter is deprecated in favour of `name` in - :class:`metrics.PrecisionRecallDisplay` and will be removed in 1.10. - By :user:`Lucy Liu `. diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/32313.fix.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/32313.fix.rst deleted file mode 100644 index b8f0fc21660da..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.metrics/32313.fix.rst +++ /dev/null @@ -1,5 +0,0 @@ -- kwargs specified in the `curve_kwargs` parameter of - :meth:`metrics.RocCurveDisplay.from_cv_results` now only overwrite their corresponding - default value before being passed to Matplotlib's `plot`. Previously, passing any - `curve_kwargs` would overwrite all default kwargs. - By :user:`Lucy Liu `. diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/32356.efficiency.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/32356.efficiency.rst deleted file mode 100644 index 03b3e41f67911..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.metrics/32356.efficiency.rst +++ /dev/null @@ -1,3 +0,0 @@ -- Avoid redundant input validation in :func:`metrics.d2_log_loss_score` - leading to a 1.2x speedup in large scale benchmarks. - By :user:`Olivier Grisel ` and :user:`Omar Salman ` diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/32356.fix.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/32356.fix.rst deleted file mode 100644 index ac611096234b6..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.metrics/32356.fix.rst +++ /dev/null @@ -1,4 +0,0 @@ -- Registered named scorer objects for :func:`metrics.d2_brier_score` and - :func:`metrics.d2_log_loss_score` and updated their input validation to be - consistent with related metric functions. - By :user:`Olivier Grisel ` and :user:`Omar Salman ` diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/32372.fix.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/32372.fix.rst deleted file mode 100644 index 5fa8d2204b312..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.metrics/32372.fix.rst +++ /dev/null @@ -1,4 +0,0 @@ -- :meth:`metrics.RocCurveDisplay.from_cv_results` will now infer `pos_label` as - `estimator.classes_[-1]`, using the estimator from `cv_results`, when - `pos_label=None`. Previously, an error was raised when `pos_label=None`. - By :user:`Lucy Liu `. diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/32549.fix.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/32549.fix.rst deleted file mode 100644 index 070e3d1e7fefe..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.metrics/32549.fix.rst +++ /dev/null @@ -1,7 +0,0 @@ -- All classification metrics now raise a `ValueError` when required input arrays - (`y_pred`, `y_true`, `y1`, `y2`, `pred_decision`, or `y_proba`) are empty. - Previously, `accuracy_score`, `class_likelihood_ratios`, `classification_report`, - `confusion_matrix`, `hamming_loss`, `jaccard_score`, `matthews_corrcoef`, - `multilabel_confusion_matrix`, and `precision_recall_fscore_support` did not raise - this error consistently. - By :user:`Stefanie Senger `. diff --git a/doc/whats_new/upcoming_changes/sklearn.model_selection/32265.enhancement.rst b/doc/whats_new/upcoming_changes/sklearn.model_selection/32265.enhancement.rst deleted file mode 100644 index b9c87bfec19d9..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.model_selection/32265.enhancement.rst +++ /dev/null @@ -1,4 +0,0 @@ -- :class:`model_selection.StratifiedShuffleSplit` will now specify which classes - have too few members when raising a ``ValueError`` if any class has less than 2 members. - This is useful to identify which classes are causing the error. - By :user:`Marc Bresson ` diff --git a/doc/whats_new/upcoming_changes/sklearn.model_selection/32540.fix.rst b/doc/whats_new/upcoming_changes/sklearn.model_selection/32540.fix.rst deleted file mode 100644 index ec15ecccee161..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.model_selection/32540.fix.rst +++ /dev/null @@ -1,3 +0,0 @@ -- Fix shuffle behaviour in :class:`model_selection.StratifiedGroupKFold`. Now - stratification among folds is also preserved when `shuffle=True`. - By :user:`Pau Folch `. diff --git a/doc/whats_new/upcoming_changes/sklearn.multiclass/15504.fix.rst b/doc/whats_new/upcoming_changes/sklearn.multiclass/15504.fix.rst deleted file mode 100644 index 177a7309ae3f3..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.multiclass/15504.fix.rst +++ /dev/null @@ -1,3 +0,0 @@ -- Fix tie-breaking behavior in :class:`multiclass.OneVsRestClassifier` to match - `np.argmax` tie-breaking behavior. - By :user:`Lakshmi Krishnan `. diff --git a/doc/whats_new/upcoming_changes/sklearn.naive_bayes/32497.fix.rst b/doc/whats_new/upcoming_changes/sklearn.naive_bayes/32497.fix.rst deleted file mode 100644 index 855dd8c238f4a..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.naive_bayes/32497.fix.rst +++ /dev/null @@ -1,3 +0,0 @@ -- :class:`naive_bayes.GaussianNB` preserves the dtype of the fitted attributes - according to the dtype of `X`. - By :user:`Omar Salman ` diff --git a/doc/whats_new/upcoming_changes/sklearn.preprocessing/28043.enhancement.rst b/doc/whats_new/upcoming_changes/sklearn.preprocessing/28043.enhancement.rst deleted file mode 100644 index 8195352292539..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.preprocessing/28043.enhancement.rst +++ /dev/null @@ -1,2 +0,0 @@ -- :class:`preprocessing.SplineTransformer` can now handle missing values with the - parameter `handle_missing`. By :user:`Stefanie Senger `. diff --git a/doc/whats_new/upcoming_changes/sklearn.preprocessing/29307.enhancement.rst b/doc/whats_new/upcoming_changes/sklearn.preprocessing/29307.enhancement.rst deleted file mode 100644 index aa9b02400a0c0..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.preprocessing/29307.enhancement.rst +++ /dev/null @@ -1,4 +0,0 @@ -- The :class:`preprocessing.PowerTransformer` now returns a warning - when NaN values are encountered in the inverse transform, `inverse_transform`, typically - caused by extremely skewed data. - By :user:`Roberto Mourao ` \ No newline at end of file diff --git a/doc/whats_new/upcoming_changes/sklearn.preprocessing/31790.enhancement.rst b/doc/whats_new/upcoming_changes/sklearn.preprocessing/31790.enhancement.rst deleted file mode 100644 index caabc96b626fd..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.preprocessing/31790.enhancement.rst +++ /dev/null @@ -1,3 +0,0 @@ -- :class:`preprocessing.MaxAbsScaler` can now clip out-of-range values in held-out data - with the parameter `clip`. - By :user:`Hleb Levitski `. diff --git a/doc/whats_new/upcoming_changes/sklearn.preprocessing/32592.fix.rst b/doc/whats_new/upcoming_changes/sklearn.preprocessing/32592.fix.rst deleted file mode 100644 index f22417a3566fb..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.preprocessing/32592.fix.rst +++ /dev/null @@ -1,2 +0,0 @@ -- Fixed a bug in :class:`preprocessing.OneHotEncoder` where `handle_unknown='warn'` incorrectly behaved like `'ignore'` instead of `'infrequent_if_exist'`. - By :user:`Nithurshen ` diff --git a/doc/whats_new/upcoming_changes/sklearn.semi_supervised/31924.fix.rst b/doc/whats_new/upcoming_changes/sklearn.semi_supervised/31924.fix.rst deleted file mode 100644 index fe21593d99680..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.semi_supervised/31924.fix.rst +++ /dev/null @@ -1,4 +0,0 @@ -- User written kernel results are now normalized in - :class:`semi_supervised.LabelPropagation` - so all row sums equal 1 even if kernel gives asymmetric or non-uniform row sums. - By :user:`Dan Schult `. diff --git a/doc/whats_new/upcoming_changes/sklearn.tree/30041.fix.rst b/doc/whats_new/upcoming_changes/sklearn.tree/30041.fix.rst deleted file mode 100644 index 98c90e31f36eb..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.tree/30041.fix.rst +++ /dev/null @@ -1,2 +0,0 @@ -- Make :func:`tree.export_text` thread-safe. - By :user:`Olivier Grisel `. diff --git a/doc/whats_new/upcoming_changes/sklearn.tree/31036.fix.rst b/doc/whats_new/upcoming_changes/sklearn.tree/31036.fix.rst deleted file mode 100644 index 32e26e180595d..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.tree/31036.fix.rst +++ /dev/null @@ -1,3 +0,0 @@ -- :func:`~sklearn.tree.export_graphviz` now raises a `ValueError` if given feature - names are not all strings. - By :user:`Guilherme Peixoto ` diff --git a/doc/whats_new/upcoming_changes/sklearn.tree/32100.efficiency.rst b/doc/whats_new/upcoming_changes/sklearn.tree/32100.efficiency.rst deleted file mode 100644 index 0df37311f22ce..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.tree/32100.efficiency.rst +++ /dev/null @@ -1,4 +0,0 @@ -- :class:`tree.DecisionTreeRegressor` with `criterion="absolute_error"` - now runs much faster: O(n log n) complexity against previous O(n^2) - allowing to scale to millions of data points, even hundred of millions. - By :user:`Arthur Lacote ` diff --git a/doc/whats_new/upcoming_changes/sklearn.tree/32100.fix.rst b/doc/whats_new/upcoming_changes/sklearn.tree/32100.fix.rst deleted file mode 100644 index 7d337131c25e6..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.tree/32100.fix.rst +++ /dev/null @@ -1,6 +0,0 @@ -- :class:`tree.DecisionTreeRegressor` with `criterion="absolute_error"` - would sometimes make sub-optimal splits - (i.e. splits that don't minimize the absolute error). - Now it's fixed. Hence retraining trees might gives slightly different - results. - By :user:`Arthur Lacote ` diff --git a/doc/whats_new/upcoming_changes/sklearn.tree/32259.fix.rst b/doc/whats_new/upcoming_changes/sklearn.tree/32259.fix.rst deleted file mode 100644 index f25f0f2eec483..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.tree/32259.fix.rst +++ /dev/null @@ -1,3 +0,0 @@ -- Fixed a regression in :ref:`decision trees ` where almost constant features were - not handled properly. - By :user:`Sercan Turkmen `. diff --git a/doc/whats_new/upcoming_changes/sklearn.tree/32274.fix.rst b/doc/whats_new/upcoming_changes/sklearn.tree/32274.fix.rst deleted file mode 100644 index 84c1123cf26c8..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.tree/32274.fix.rst +++ /dev/null @@ -1,6 +0,0 @@ -- Fixed splitting logic during training in :class:`tree.DecisionTree*` - (and consequently in :class:`ensemble.RandomForest*`) - for nodes containing near-constant feature values and missing values. - Beforehand, trees were cut short if a constant feature was found, - even if there was more splitting that could be done on the basis of missing values. - By :user:`Arthur Lacote ` diff --git a/doc/whats_new/upcoming_changes/sklearn.tree/32280.fix.rst b/doc/whats_new/upcoming_changes/sklearn.tree/32280.fix.rst deleted file mode 100644 index 5ff0a9b453e77..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.tree/32280.fix.rst +++ /dev/null @@ -1,4 +0,0 @@ -- Fix handling of missing values in method :func:`decision_path` of trees - (:class:`tree.DecisionTreeClassifier`, :class:`tree.DecisionTreeRegressor`, - :class:`tree.ExtraTreeClassifier` and :class:`tree.ExtraTreeRegressor`) - By :user:`Arthur Lacote `. diff --git a/doc/whats_new/upcoming_changes/sklearn.tree/32351.fix.rst b/doc/whats_new/upcoming_changes/sklearn.tree/32351.fix.rst deleted file mode 100644 index 0c422d7a9e14c..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.tree/32351.fix.rst +++ /dev/null @@ -1,3 +0,0 @@ -- Fix decision tree splitting with missing values present in some features. In some cases the last - non-missing sample would not be partitioned correctly. - By :user:`Tim Head ` and :user:`Arthur Lacote `. diff --git a/doc/whats_new/upcoming_changes/sklearn.utils/31564.enhancement.rst b/doc/whats_new/upcoming_changes/sklearn.utils/31564.enhancement.rst deleted file mode 100644 index 6b9ef89fdd01f..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.utils/31564.enhancement.rst +++ /dev/null @@ -1,5 +0,0 @@ -- The parameter table in the HTML representation of all scikit-learn estimators and - more generally of estimators inheriting from :class:`base.BaseEstimator` - now displays the parameter description as a tooltip and has a link to the online - documentation for each parameter. - By :user:`Dea María Léon `. diff --git a/doc/whats_new/upcoming_changes/sklearn.utils/31873.enhancement.rst b/doc/whats_new/upcoming_changes/sklearn.utils/31873.enhancement.rst deleted file mode 100644 index 6e82ce3713f5a..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.utils/31873.enhancement.rst +++ /dev/null @@ -1,4 +0,0 @@ -- ``sklearn.utils._check_sample_weight`` now raises a clearer error message when the - provided weights are neither a scalar nor a 1-D array-like of the same size as the - input data. - By :user:`Kapil Parekh `. diff --git a/doc/whats_new/upcoming_changes/sklearn.utils/31951.enhancement.rst b/doc/whats_new/upcoming_changes/sklearn.utils/31951.enhancement.rst deleted file mode 100644 index 556c406bff7b8..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.utils/31951.enhancement.rst +++ /dev/null @@ -1,4 +0,0 @@ -- :func:`sklearn.utils.estimator_checks.parametrize_with_checks` now lets you configure - strict mode for xfailing checks. Tests that unexpectedly pass will lead to a test - failure. The default behaviour is unchanged. - By :user:`Tim Head `. diff --git a/doc/whats_new/upcoming_changes/sklearn.utils/31952.efficiency.rst b/doc/whats_new/upcoming_changes/sklearn.utils/31952.efficiency.rst deleted file mode 100644 index f334bfd81c8dd..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.utils/31952.efficiency.rst +++ /dev/null @@ -1,5 +0,0 @@ -- The function :func:`sklearn.utils.extmath.safe_sparse_dot` was improved by a dedicated - Cython routine for the case of `a @ b` with sparse 2-dimensional `a` and `b` and when - a dense output is required, i.e., `dense_output=True`. This improves several - algorithms in scikit-learn when dealing with sparse arrays (or matrices). - By :user:`Christian Lorentzen `. diff --git a/doc/whats_new/upcoming_changes/sklearn.utils/31969.enhancement.rst b/doc/whats_new/upcoming_changes/sklearn.utils/31969.enhancement.rst deleted file mode 100644 index 079b9c589bc91..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.utils/31969.enhancement.rst +++ /dev/null @@ -1,3 +0,0 @@ -- Fixed the alignment of the "?" and "i" symbols and improved the color style of the - HTML representation of estimators. - By :user:`Guillaume Lemaitre `. diff --git a/doc/whats_new/upcoming_changes/sklearn.utils/32258.api.rst b/doc/whats_new/upcoming_changes/sklearn.utils/32258.api.rst deleted file mode 100644 index a8ab5744ddf87..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.utils/32258.api.rst +++ /dev/null @@ -1,3 +0,0 @@ -- :func:`utils.extmath.stable_cumsum` is deprecated and will be removed - in v1.10. Use `np.cumulative_sum` with the desired dtype directly instead. - By :user:`Tiziano Zito `. diff --git a/doc/whats_new/upcoming_changes/sklearn.utils/32330.fix.rst b/doc/whats_new/upcoming_changes/sklearn.utils/32330.fix.rst deleted file mode 100644 index c2243ad2f7c3b..0000000000000 --- a/doc/whats_new/upcoming_changes/sklearn.utils/32330.fix.rst +++ /dev/null @@ -1,2 +0,0 @@ -- Changes the way color are chosen when displaying an estimator as an HTML representation. Colors are not adapted anymore to the user's theme, but chosen based on theme declared color scheme (light or dark) for VSCode and JupyterLab. If theme does not declare a color scheme, scheme is chosen according to default text color of the page, if it fails fallbacks to a media query. - By :user:`Matt J. `. diff --git a/doc/whats_new/v1.8.rst b/doc/whats_new/v1.8.rst index 603373824d395..fa39c6f1fed43 100644 --- a/doc/whats_new/v1.8.rst +++ b/doc/whats_new/v1.8.rst @@ -26,9 +26,680 @@ Version 1.8 .. towncrier release notes start +.. _changes_1_8_0: + +Version 1.8.0 +============= + +**December 2025** + +Changes impacting many modules +------------------------------ + +- |Efficiency| Improved CPU and memory usage in estimators and metric functions that rely on + weighted percentiles and better match NumPy and Scipy (un-weighted) implementations + of percentiles. + By :user:`Lucy Liu ` :pr:`31775` + +Support for Array API +--------------------- + +Additional estimators and functions have been updated to include support for all +`Array API `_ compliant inputs. + +See :ref:`array_api` for more details. + +- |Feature| :class:`sklearn.preprocessing.StandardScaler` now supports Array API compliant inputs. + By :user:`Alexander Fabisch `, :user:`Edoardo Abati `, + :user:`Olivier Grisel ` and :user:`Charles Hill `. :pr:`27113` + +- |Feature| :class:`linear_model.RidgeCV`, :class:`linear_model.RidgeClassifier` and + :class:`linear_model.RidgeClassifierCV` now support array API compatible + inputs with `solver="svd"`. + By :user:`Jérôme Dockès `. :pr:`27961` + +- |Feature| :func:`metrics.pairwise.pairwise_kernels` for any kernel except + "laplacian" and + :func:`metrics.pairwise_distances` for metrics "cosine", + "euclidean" and "l2" now support array API inputs. + By :user:`Emily Chen ` and :user:`Lucy Liu ` :pr:`29822` + +- |Feature| :func:`sklearn.metrics.confusion_matrix` now supports Array API compatible inputs. + By :user:`Stefanie Senger ` :pr:`30562` + +- |Feature| :class:`sklearn.mixture.GaussianMixture` with + `init_params="random"` or `init_params="random_from_data"` and + `warm_start=False` now supports Array API compatible inputs. + By :user:`Stefanie Senger ` and :user:`Loïc Estève ` :pr:`30777` + +- |Feature| :func:`sklearn.metrics.roc_curve` now supports Array API compatible inputs. + By :user:`Thomas Li ` :pr:`30878` + +- |Feature| :class:`preprocessing.PolynomialFeatures` now supports array API compatible inputs. + By :user:`Omar Salman ` :pr:`31580` + +- |Feature| :class:`calibration.CalibratedClassifierCV` now supports array API compatible + inputs with `method="temperature"` and when the underlying `estimator` also + supports the array API. + By :user:`Omar Salman ` :pr:`32246` + +- |Feature| :func:`sklearn.metrics.precision_recall_curve` now supports array API compatible + inputs. + By :user:`Lucy Liu ` :pr:`32249` + +- |Feature| :func:`sklearn.model_selection.cross_val_predict` now supports array API compatible inputs. + By :user:`Omar Salman ` :pr:`32270` + +- |Feature| :func:`sklearn.metrics.brier_score_loss`, :func:`sklearn.metrics.log_loss`, + :func:`sklearn.metrics.d2_brier_score` and :func:`sklearn.metrics.d2_log_loss_score` + now support array API compatible inputs. + By :user:`Omar Salman ` :pr:`32422` + +- |Feature| :class:`naive_bayes.GaussianNB` now supports array API compatible inputs. + By :user:`Omar Salman ` :pr:`32497` + +- |Feature| :class:`preprocessing.LabelBinarizer` and :func:`preprocessing.label_binarize` now + support numeric array API compatible inputs with `sparse_output=False`. + By :user:`Virgil Chan `. :pr:`32582` + +- |Feature| :func:`sklearn.metrics.det_curve` now supports Array API compliant inputs. + By :user:`Josef Affourtit `. :pr:`32586` + +- |Feature| :func:`sklearn.metrics.pairwise.manhattan_distances` now supports array API compatible inputs. + By :user:`Omar Salman `. :pr:`32597` + +- |Feature| :func:`sklearn.metrics.calinski_harabasz_score` now supports Array API compliant inputs. + By :user:`Josef Affourtit `. :pr:`32600` + +- |Feature| :func:`sklearn.metrics.balanced_accuracy_score` now supports array API compatible inputs. + By :user:`Omar Salman `. :pr:`32604` + +- |Feature| :func:`sklearn.metrics.pairwise.laplacian_kernel` now supports array API compatible inputs. + By :user:`Zubair Shakoor `. :pr:`32613` + +- |Feature| :func:`sklearn.metrics.cohen_kappa_score` now supports array API compatible inputs. + By :user:`Omar Salman `. :pr:`32619` + +- |Feature| :func:`sklearn.metrics.cluster.davies_bouldin_score` now supports Array API compliant inputs. + By :user:`Josef Affourtit `. :pr:`32693` + +- |Fix| Estimators with array API support no longer reject dataframe inputs when array API support is enabled. + By :user:`Tim Head ` :pr:`32838` + +Metadata routing +---------------- + +Refer to the :ref:`Metadata Routing User Guide ` for +more details. + +- |Fix| Fixed an issue where passing `sample_weight` to a :class:`Pipeline` inside a + :class:`GridSearchCV` would raise an error with metadata routing enabled. + By `Adrin Jalali`_. :pr:`31898` + +Free-threaded CPython 3.14 support +---------------------------------- + +scikit-learn has support for free-threaded CPython, in particular +free-threaded wheels are available for all of our supported platforms on Python +3.14. + +Free-threaded (also known as nogil) CPython is a version of CPython that aims at +enabling efficient multi-threaded use cases by removing the Global Interpreter +Lock (GIL). + +If you want to try out free-threaded Python, the recommendation is to use +Python 3.14, that has fixed a number of issues compared to Python 3.13. Feel +free to try free-threaded on your use case and report any issues! + +For more details about free-threaded CPython see `py-free-threading doc `_, +in particular `how to install a free-threaded CPython `_ +and `Ecosystem compatibility tracking `_. + +By :user:`Loïc Estève ` and :user:`Olivier Grisel ` and many +other people in the wider Scientific Python and CPython ecosystem, for example +:user:`Nathan Goldbaum `, :user:`Ralf Gommers `, +:user:`Edgar Andrés Margffoy Tuay `. :pr:`32079` + +:mod:`sklearn.base` +------------------- + +- |Feature| Refactored :meth:`dir` in :class:`BaseEstimator` to recognize condition check in :meth:`available_if`. + By :user:`John Hendricks ` and :user:`Miguel Parece `. :pr:`31928` + +- |Fix| Fixed the handling of pandas missing values in HTML display of all estimators. + By :user:`Dea María Léon `. :pr:`32341` + +:mod:`sklearn.calibration` +-------------------------- + +- |Feature| Added temperature scaling method in :class:`calibration.CalibratedClassifierCV`. + By :user:`Virgil Chan ` and :user:`Christian Lorentzen `. :pr:`31068` + +:mod:`sklearn.cluster` +---------------------- + +- |Efficiency| :func:`cluster.kmeans_plusplus` now uses `np.cumsum` directly without extra + numerical stability checks and without casting to `np.float64`. + By :user:`Tiziano Zito ` :pr:`31991` + +- |Fix| The default value of the `copy` parameter in :class:`cluster.HDBSCAN` + will change from `False` to `True` in 1.10 to avoid data modification + and maintain consistency with other estimators. + By :user:`Sarthak Puri `. :pr:`31973` + +:mod:`sklearn.compose` +---------------------- + +- |Fix| The :class:`compose.ColumnTransformer` now correctly fits on data provided as a + `polars.DataFrame` when any transformer has a sparse output. + By :user:`Phillipp Gnan `. :pr:`32188` + +:mod:`sklearn.covariance` +------------------------- + +- |Efficiency| :class:`sklearn.covariance.GraphicalLasso`, + :class:`sklearn.covariance.GraphicalLassoCV` and + :func:`sklearn.covariance.graphical_lasso` with `mode="cd"` profit from the + fit time performance improvement of :class:`sklearn.linear_model.Lasso` by means of + gap safe screening rules. + By :user:`Christian Lorentzen `. :pr:`31987` + +- |Fix| Fixed uncontrollable randomness in :class:`sklearn.covariance.GraphicalLasso`, + :class:`sklearn.covariance.GraphicalLassoCV` and + :func:`sklearn.covariance.graphical_lasso`. For `mode="cd"`, they now use cyclic + coordinate descent. Before, it was random coordinate descent with uncontrollable + random number seeding. + By :user:`Christian Lorentzen `. :pr:`31987` + +- |Fix| Added correction to :class:`covariance.MinCovDet` to adjust for + consistency at the normal distribution. This reduces the bias present + when applying this method to data that is normally distributed. + By :user:`Daniel Herrera-Esposito ` :pr:`32117` + +:mod:`sklearn.decomposition` +---------------------------- + +- |Efficiency| :class:`sklearn.decomposition.DictionaryLearning` and + :class:`sklearn.decomposition.MiniBatchDictionaryLearning` with `fit_algorithm="cd"`, + :class:`sklearn.decomposition.SparseCoder` with `transform_algorithm="lasso_cd"`, + :class:`sklearn.decomposition.MiniBatchSparsePCA`, + :class:`sklearn.decomposition.SparsePCA`, + :func:`sklearn.decomposition.dict_learning` and + :func:`sklearn.decomposition.dict_learning_online` with `method="cd"`, + :func:`sklearn.decomposition.sparse_encode` with `algorithm="lasso_cd"` + all profit from the fit time performance improvement of + :class:`sklearn.linear_model.Lasso` by means of gap safe screening rules. + By :user:`Christian Lorentzen `. :pr:`31987` + +- |Enhancement| :class:`decomposition.SparseCoder` now follows the transformer API of scikit-learn. + In addition, the :meth:`fit` method now validates the input and parameters. + By :user:`François Paugam `. :pr:`32077` + +- |Fix| Add input checks to the `inverse_transform` method of :class:`decomposition.PCA` + and :class:`decomposition.IncrementalPCA`. + :pr:`29310` by :user:`Ian Faust `. :pr:`29310` + +:mod:`sklearn.discriminant_analysis` +------------------------------------ + +- |Feature| Added `solver`, `covariance_estimator` and `shrinkage` in + :class:`discriminant_analysis.QuadraticDiscriminantAnalysis`. + The resulting class is more similar to + :class:`discriminant_analysis.LinearDiscriminantAnalysis` + and allows for more flexibility in the estimation of the covariance matrices. + By :user:`Daniel Herrera-Esposito `. :pr:`32108` + +:mod:`sklearn.ensemble` +----------------------- + +- |Fix| :class:`ensemble.BaggingClassifier`, :class:`ensemble.BaggingRegressor` and + :class:`ensemble.IsolationForest` now use `sample_weight` to draw the samples + instead of forwarding them multiplied by a uniformly sampled mask to the + underlying estimators. Furthermore, when `max_samples` is a float, it is now + interpreted as a fraction of `sample_weight.sum()` instead of `X.shape[0]`. + The new default `max_samples=None` draws `X.shape[0]` samples, irrespective + of `sample_weight`. + By :user:`Antoine Baker `. :pr:`31414` and :pr:`32825` + +:mod:`sklearn.feature_selection` +-------------------------------- + +- |Enhancement| :class:`feature_selection.SelectFromModel` now does not force `max_features` to be + less than or equal to the number of input features. + By :user:`Thibault ` :pr:`31939` + +:mod:`sklearn.gaussian_process` +------------------------------- + +- |Efficiency| make :class:`GaussianProcessRegressor.predict` faster when `return_cov` and + `return_std` are both `False`. + By :user:`Rafael Ayllón Gavilán `. :pr:`31431` + +:mod:`sklearn.linear_model` +--------------------------- + +- |Efficiency| :class:`linear_model.ElasticNet` and :class:`linear_model.Lasso` with + `precompute=False` use less memory for dense `X` and are a bit faster. + Previously, they used twice the memory of `X` even for Fortran-contiguous `X`. + By :user:`Christian Lorentzen ` :pr:`31665` + +- |Efficiency| :class:`linear_model.ElasticNet` and :class:`linear_model.Lasso` avoid + double input checking and are therefore a bit faster. + By :user:`Christian Lorentzen `. :pr:`31848` + +- |Efficiency| :class:`linear_model.ElasticNet`, :class:`linear_model.ElasticNetCV`, + :class:`linear_model.Lasso`, :class:`linear_model.LassoCV`, + :class:`linear_model.MultiTaskElasticNet`, + :class:`linear_model.MultiTaskElasticNetCV`, + :class:`linear_model.MultiTaskLasso` and :class:`linear_model.MultiTaskLassoCV` + are faster to fit by avoiding a BLAS level 1 (axpy) call in the innermost loop. + Same for functions :func:`linear_model.enet_path` and + :func:`linear_model.lasso_path`. + By :user:`Christian Lorentzen ` :pr:`31956` and :pr:`31880` + +- |Efficiency| :class:`linear_model.ElasticNetCV`, :class:`linear_model.LassoCV`, + :class:`linear_model.MultiTaskElasticNetCV` and :class:`linear_model.MultiTaskLassoCV` + avoid an additional copy of `X` with default `copy_X=True`. + By :user:`Christian Lorentzen `. :pr:`31946` + +- |Efficiency| :class:`linear_model.ElasticNet`, :class:`linear_model.ElasticNetCV`, + :class:`linear_model.Lasso`, :class:`linear_model.LassoCV`, + :class:`linear_model.MultiTaskElasticNet`, :class:`linear_model.MultiTaskElasticNetCV` + :class:`linear_model.MultiTaskLasso`, :class:`linear_model.MultiTaskLassoCV` + as well as + :func:`linear_model.lasso_path` and :func:`linear_model.enet_path` now implement + gap safe screening rules in the coordinate descent solver for dense and sparse `X`. + The speedup of fitting time is particularly pronounced (10-times is possible) when + computing regularization paths like the \*CV-variants of the above estimators do. + There is now an additional check of the stopping criterion before entering the main + loop of descent steps. As the stopping criterion requires the computation of the dual + gap, the screening happens whenever the dual gap is computed. + By :user:`Christian Lorentzen ` :pr:`31882`, :pr:`31986`, + :pr:`31987` and :pr:`32014` + +- |Enhancement| :class:`linear_model.ElasticNet`, :class:`linear_model.ElasticNetCV`, + :class:`linear_model.Lasso`, :class:`linear_model.LassoCV`, + :class:`MultiTaskElasticNet`, :class:`MultiTaskElasticNetCV`, + :class:`MultiTaskLasso`, :class:`MultiTaskLassoCV`, as well as + :func:`linear_model.enet_path` and :func:`linear_model.lasso_path` + now use `dual gap <= tol` instead of `dual gap < tol` as stopping criterion. + The resulting coefficients might differ to previous versions of scikit-learn in + rare cases. + By :user:`Christian Lorentzen `. :pr:`31906` + +- |Fix| Fix the convergence criteria for SGD models, to avoid premature convergence when + `tol != None`. This primarily impacts :class:`SGDOneClassSVM` but also affects + :class:`SGDClassifier` and :class:`SGDRegressor`. Before this fix, only the loss + function without penalty was used as the convergence check, whereas now, the full + objective with regularization is used. + By :user:`Guillaume Lemaitre ` and :user:`kostayScr ` :pr:`31856` + +- |Fix| The allowed parameter range for the initial learning rate `eta0` in + :class:`linear_model.SGDClassifier`, :class:`linear_model.SGDOneClassSVM`, + :class:`linear_model.SGDRegressor` and :class:`linear_model.Perceptron` + changed from non-negative numbers to strictly positive numbers. + As a consequence, the default `eta0` of :class:`linear_model.SGDClassifier` + and :class:`linear_model.SGDOneClassSVM` changed from 0 to 0.01. But note that + `eta0` is not used by the default learning rate "optimal" of those two estimators. + By :user:`Christian Lorentzen `. :pr:`31933` + +- |Fix| :class:`linear_model.LogisticRegressionCV` is able to handle CV splits where + some class labels are missing in some folds. Before, it raised an error whenever a + class label were missing in a fold. + By :user:`Christian Lorentzen `. :pr:`32747` + +- |API| :class:`linear_model.PassiveAggressiveClassifier` and + :class:`linear_model.PassiveAggressiveRegressor` are deprecated and will be removed + in 1.10. Equivalent estimators are available with :class:`linear_model.SGDClassifier` + and :class:`SGDRegressor`, both of which expose the options `learning_rate="pa1"` and + `"pa2"`. The parameter `eta0` can be used to specify the aggressiveness parameter of + the Passive-Aggressive-Algorithms, called C in the reference paper. + By :user:`Christian Lorentzen ` :pr:`31932` and :pr:`29097` + +- |API| :class:`linear_model.SGDClassifier`, :class:`linear_model.SGDRegressor`, and + :class:`linear_model.SGDOneClassSVM` now deprecate negative values for the + `power_t` parameter. Using a negative value will raise a warning in version 1.8 + and will raise an error in version 1.10. A value in the range [0.0, inf) must be used + instead. + By :user:`Ritvi Alagusankar ` :pr:`31474` + +- |API| Raising error in :class:`sklearn.linear_model.LogisticRegression` when + liblinear solver is used and input X values are larger than 1e30, + the liblinear solver freezes otherwise. + By :user:`Shruti Nath `. :pr:`31888` + +- |API| :class:`linear_model.LogisticRegressionCV` got a new parameter + `use_legacy_attributes` to control the types and shapes of the fitted attributes + `C_`, `l1_ratio_`, `coefs_paths_`, `scores_` and `n_iter_`. + The current default value `True` keeps the legacy behaviour. If `False` then: + + - ``C_`` is a float. + - ``l1_ratio_`` is a float. + - ``coefs_paths_`` is an ndarray of shape + (n_folds, n_l1_ratios, n_cs, n_classes, n_features). + For binary problems (n_classes=2), the 2nd last dimension is 1. + - ``scores_`` is an ndarray of shape (n_folds, n_l1_ratios, n_cs). + - ``n_iter_`` is an ndarray of shape (n_folds, n_l1_ratios, n_cs). + + In version 1.10, the default will change to `False` and `use_legacy_attributes` will + be deprecated. In 1.12 `use_legacy_attributes` will be removed. + By :user:`Christian Lorentzen `. :pr:`32114` + +- |API| Parameter `penalty` of :class:`linear_model.LogisticRegression` and + :class:`linear_model.LogisticRegressionCV` is deprecated and will be removed in + version 1.10. The equivalent behaviour can be obtained as follows: + + - for :class:`linear_model.LogisticRegression` + + - use `l1_ratio=0` instead of `penalty="l2"` + - use `l1_ratio=1` instead of `penalty="l1"` + - use `0`. :pr:`32659` + +- |API| The `n_jobs` parameter of :class:`linear_model.LogisticRegression` is deprecated and + will be removed in 1.10. It has no effect since 1.8. + By :user:`Loïc Estève `. :pr:`32742` + +:mod:`sklearn.manifold` +----------------------- + +- |MajorFeature| :class:`manifold.ClassicalMDS` was implemented to perform classical MDS + (eigendecomposition of the double-centered distance matrix). + By :user:`Dmitry Kobak ` and :user:`Meekail Zain ` :pr:`31322` + +- |Feature| :class:`manifold.MDS` now supports arbitrary distance metrics + (via `metric` and `metric_params` parameters) and + initialization via classical MDS (via `init` parameter). + The `dissimilarity` parameter was deprecated. The old `metric` parameter + was renamed into `metric_mds`. + By :user:`Dmitry Kobak ` :pr:`32229` + +- |Feature| :class:`manifold.TSNE` now supports PCA initialization with sparse input matrices. + By :user:`Arturo Amor `. :pr:`32433` + +:mod:`sklearn.metrics` +---------------------- + +- |Feature| :func:`metrics.d2_brier_score` has been added which calculates the D^2 for the Brier score. + By :user:`Omar Salman `. :pr:`28971` + +- |Feature| Add :func:`metrics.confusion_matrix_at_thresholds` function that returns the number of + true negatives, false positives, false negatives and true positives per threshold. + By :user:`Success Moses `. :pr:`30134` + +- |Efficiency| Avoid redundant input validation in :func:`metrics.d2_log_loss_score` + leading to a 1.2x speedup in large scale benchmarks. + By :user:`Olivier Grisel ` and :user:`Omar Salman ` :pr:`32356` + +- |Enhancement| :func:`metrics.median_absolute_error` now supports Array API compatible inputs. + By :user:`Lucy Liu `. :pr:`31406` + +- |Enhancement| Improved the error message for sparse inputs for the following metrics: + :func:`metrics.accuracy_score`, + :func:`metrics.multilabel_confusion_matrix`, :func:`metrics.jaccard_score`, + :func:`metrics.zero_one_loss`, :func:`metrics.f1_score`, + :func:`metrics.fbeta_score`, :func:`metrics.precision_recall_fscore_support`, + :func:`metrics.class_likelihood_ratios`, :func:`metrics.precision_score`, + :func:`metrics.recall_score`, :func:`metrics.classification_report`, + :func:`metrics.hamming_loss`. + By :user:`Lucy Liu `. :pr:`32047` + +- |Fix| :func:`metrics.median_absolute_error` now uses `_averaged_weighted_percentile` + instead of `_weighted_percentile` to calculate median when `sample_weight` is not + `None`. This is equivalent to using the "averaged_inverted_cdf" instead of + the "inverted_cdf" quantile method, which gives results equivalent to `numpy.median` + if equal weights used. + By :user:`Lucy Liu ` :pr:`30787` + +- |Fix| Additional `sample_weight` checking has been added to + :func:`metrics.accuracy_score`, + :func:`metrics.balanced_accuracy_score`, + :func:`metrics.brier_score_loss`, + :func:`metrics.class_likelihood_ratios`, + :func:`metrics.classification_report`, + :func:`metrics.cohen_kappa_score`, + :func:`metrics.confusion_matrix`, + :func:`metrics.f1_score`, + :func:`metrics.fbeta_score`, + :func:`metrics.hamming_loss`, + :func:`metrics.jaccard_score`, + :func:`metrics.matthews_corrcoef`, + :func:`metrics.multilabel_confusion_matrix`, + :func:`metrics.precision_recall_fscore_support`, + :func:`metrics.precision_score`, + :func:`metrics.recall_score` and + :func:`metrics.zero_one_loss`. + `sample_weight` can only be 1D, consistent to `y_true` and `y_pred` in length,and + all values must be finite and not complex. + By :user:`Lucy Liu `. :pr:`31701` + +- |Fix| `y_pred` is deprecated in favour of `y_score` in + :func:`metrics.DetCurveDisplay.from_predictions` and + :func:`metrics.PrecisionRecallDisplay.from_predictions`. `y_pred` will be removed in + v1.10. + By :user:`Luis ` :pr:`31764` + +- |Fix| `repr` on a scorer which has been created with a `partial` `score_func` now correctly + works and uses the `repr` of the given `partial` object. + By `Adrin Jalali`_. :pr:`31891` + +- |Fix| kwargs specified in the `curve_kwargs` parameter of + :meth:`metrics.RocCurveDisplay.from_cv_results` now only overwrite their corresponding + default value before being passed to Matplotlib's `plot`. Previously, passing any + `curve_kwargs` would overwrite all default kwargs. + By :user:`Lucy Liu `. :pr:`32313` + +- |Fix| Registered named scorer objects for :func:`metrics.d2_brier_score` and + :func:`metrics.d2_log_loss_score` and updated their input validation to be + consistent with related metric functions. + By :user:`Olivier Grisel ` and :user:`Omar Salman ` :pr:`32356` + +- |Fix| :meth:`metrics.RocCurveDisplay.from_cv_results` will now infer `pos_label` as + `estimator.classes_[-1]`, using the estimator from `cv_results`, when + `pos_label=None`. Previously, an error was raised when `pos_label=None`. + By :user:`Lucy Liu `. :pr:`32372` + +- |Fix| All classification metrics now raise a `ValueError` when required input arrays + (`y_pred`, `y_true`, `y1`, `y2`, `pred_decision`, or `y_proba`) are empty. + Previously, `accuracy_score`, `class_likelihood_ratios`, `classification_report`, + `confusion_matrix`, `hamming_loss`, `jaccard_score`, `matthews_corrcoef`, + `multilabel_confusion_matrix`, and `precision_recall_fscore_support` did not raise + this error consistently. + By :user:`Stefanie Senger `. :pr:`32549` + +- |API| :func:`metrics.cluster.entropy` is deprecated and will be removed in v1.10. + By :user:`Lucy Liu ` :pr:`31294` + +- |API| The `estimator_name` parameter is deprecated in favour of `name` in + :class:`metrics.PrecisionRecallDisplay` and will be removed in 1.10. + By :user:`Lucy Liu `. :pr:`32310` + +:mod:`sklearn.model_selection` +------------------------------ + +- |Enhancement| :class:`model_selection.StratifiedShuffleSplit` will now specify which classes + have too few members when raising a ``ValueError`` if any class has less than 2 members. + This is useful to identify which classes are causing the error. + By :user:`Marc Bresson ` :pr:`32265` + +- |Fix| Fix shuffle behaviour in :class:`model_selection.StratifiedGroupKFold`. Now + stratification among folds is also preserved when `shuffle=True`. + By :user:`Pau Folch `. :pr:`32540` + +:mod:`sklearn.multiclass` +------------------------- + +- |Fix| Fix tie-breaking behavior in :class:`multiclass.OneVsRestClassifier` to match + `np.argmax` tie-breaking behavior. + By :user:`Lakshmi Krishnan `. :pr:`15504` + +:mod:`sklearn.naive_bayes` +-------------------------- + +- |Fix| :class:`naive_bayes.GaussianNB` preserves the dtype of the fitted attributes + according to the dtype of `X`. + By :user:`Omar Salman ` :pr:`32497` + +:mod:`sklearn.preprocessing` +---------------------------- + +- |Enhancement| :class:`preprocessing.SplineTransformer` can now handle missing values with the + parameter `handle_missing`. By :user:`Stefanie Senger `. :pr:`28043` + +- |Enhancement| The :class:`preprocessing.PowerTransformer` now returns a warning + when NaN values are encountered in the inverse transform, `inverse_transform`, typically + caused by extremely skewed data. + By :user:`Roberto Mourao ` :pr:`29307` + +- |Enhancement| :class:`preprocessing.MaxAbsScaler` can now clip out-of-range values in held-out data + with the parameter `clip`. + By :user:`Hleb Levitski `. :pr:`31790` + +- |Fix| Fixed a bug in :class:`preprocessing.OneHotEncoder` where `handle_unknown='warn'` incorrectly behaved like `'ignore'` instead of `'infrequent_if_exist'`. + By :user:`Nithurshen ` :pr:`32592` + +:mod:`sklearn.semi_supervised` +------------------------------ + +- |Fix| User written kernel results are now normalized in + :class:`semi_supervised.LabelPropagation` + so all row sums equal 1 even if kernel gives asymmetric or non-uniform row sums. + By :user:`Dan Schult `. :pr:`31924` + +:mod:`sklearn.tree` +------------------- + +- |Efficiency| :class:`tree.DecisionTreeRegressor` with `criterion="absolute_error"` + now runs much faster: O(n log n) complexity against previous O(n^2) + allowing to scale to millions of data points, even hundred of millions. + By :user:`Arthur Lacote ` :pr:`32100` + +- |Fix| Make :func:`tree.export_text` thread-safe. + By :user:`Olivier Grisel `. :pr:`30041` + +- |Fix| :func:`~sklearn.tree.export_graphviz` now raises a `ValueError` if given feature + names are not all strings. + By :user:`Guilherme Peixoto ` :pr:`31036` + +- |Fix| :class:`tree.DecisionTreeRegressor` with `criterion="absolute_error"` + would sometimes make sub-optimal splits + (i.e. splits that don't minimize the absolute error). + Now it's fixed. Hence retraining trees might gives slightly different + results. + By :user:`Arthur Lacote ` :pr:`32100` + +- |Fix| Fixed a regression in :ref:`decision trees ` where almost constant features were + not handled properly. + By :user:`Sercan Turkmen `. :pr:`32259` + +- |Fix| Fixed splitting logic during training in :class:`tree.DecisionTree*` + (and consequently in :class:`ensemble.RandomForest*`) + for nodes containing near-constant feature values and missing values. + Beforehand, trees were cut short if a constant feature was found, + even if there was more splitting that could be done on the basis of missing values. + By :user:`Arthur Lacote ` :pr:`32274` + +- |Fix| Fix handling of missing values in method :func:`decision_path` of trees + (:class:`tree.DecisionTreeClassifier`, :class:`tree.DecisionTreeRegressor`, + :class:`tree.ExtraTreeClassifier` and :class:`tree.ExtraTreeRegressor`) + By :user:`Arthur Lacote `. :pr:`32280` + +- |Fix| Fix decision tree splitting with missing values present in some features. In some cases the last + non-missing sample would not be partitioned correctly. + By :user:`Tim Head ` and :user:`Arthur Lacote `. :pr:`32351` + +:mod:`sklearn.utils` +-------------------- + +- |Efficiency| The function :func:`sklearn.utils.extmath.safe_sparse_dot` was improved by a dedicated + Cython routine for the case of `a @ b` with sparse 2-dimensional `a` and `b` and when + a dense output is required, i.e., `dense_output=True`. This improves several + algorithms in scikit-learn when dealing with sparse arrays (or matrices). + By :user:`Christian Lorentzen `. :pr:`31952` + +- |Enhancement| The parameter table in the HTML representation of all scikit-learn estimators and + more generally of estimators inheriting from :class:`base.BaseEstimator` + now displays the parameter description as a tooltip and has a link to the online + documentation for each parameter. + By :user:`Dea María Léon `. :pr:`31564` + +- |Enhancement| ``sklearn.utils._check_sample_weight`` now raises a clearer error message when the + provided weights are neither a scalar nor a 1-D array-like of the same size as the + input data. + By :user:`Kapil Parekh `. :pr:`31873` + +- |Enhancement| :func:`sklearn.utils.estimator_checks.parametrize_with_checks` now lets you configure + strict mode for xfailing checks. Tests that unexpectedly pass will lead to a test + failure. The default behaviour is unchanged. + By :user:`Tim Head `. :pr:`31951` + +- |Enhancement| Fixed the alignment of the "?" and "i" symbols and improved the color style of the + HTML representation of estimators. + By :user:`Guillaume Lemaitre `. :pr:`31969` + +- |Fix| Changes the way color are chosen when displaying an estimator as an HTML representation. Colors are not adapted anymore to the user's theme, but chosen based on theme declared color scheme (light or dark) for VSCode and JupyterLab. If theme does not declare a color scheme, scheme is chosen according to default text color of the page, if it fails fallbacks to a media query. + By :user:`Matt J. `. :pr:`32330` + +- |API| :func:`utils.extmath.stable_cumsum` is deprecated and will be removed + in v1.10. Use `np.cumulative_sum` with the desired dtype directly instead. + By :user:`Tiziano Zito `. :pr:`32258` + .. rubric:: Code and documentation contributors Thanks to everyone who has contributed to the maintenance and improvement of the project since version 1.7, including: -TODO: update at the time of the release. +$id, 4hm3d, Acciaro Gennaro Daniele, achyuthan.s, Adam J. Stewart, Adriano +Leão, Adrien Linares, Adrin Jalali, Aitsaid Azzedine Idir, Alexander Fabisch, +Alexandre Abraham, Andrés H. Zapke, Anne Beyer, Anthony Gitter, AnthonyPrudent, +antoinebaker, Arpan Mukherjee, Arthur, Arthur Lacote, Arturo Amor, +ayoub.agouzoul, Ayrat, Ayush, Ayush Tanwar, Basile Jezequel, Bhavya Patwa, +BRYANT MUSI BABILA, Casey Heath, Chems Ben, Christian Lorentzen, Christian +Veenhuis, Christine P. Chai, cstec, C. Titus Brown, Daniel Herrera-Esposito, +Dan Schult, dbXD320, Dea María Léon, Deepyaman Datta, dependabot[bot], Dhyey +Findoriya, Dimitri Papadopoulos Orfanos, Dipak Dhangar, Dmitry Kobak, +elenafillo, Elham Babaei, EmilyXinyi, Emily (Xinyi) Chen, Eugen-Bleck, Evgeni +Burovski, fabarca, Fabrizio Damicelli, Faizan-Ul Huda, François Goupil, +François Paugam, Gaetan, GaetandeCast, Gesa Loof, Gonçalo Guiomar, Gordon Grey, +Gowtham Kumar K., Guilherme Peixoto, Guillaume Lemaitre, hakan çanakçı, Harshil +Sanghvi, Henri Bonamy, Hleb Levitski, HulusiOzy, hvtruong, Ian Faust, Imad +Saddik, Jérémie du Boisberranger, Jérôme Dockès, John Hendricks, Joris Van den +Bossche, Josef Affourtit, Josh, jshn9515, Junaid, KALLA GANASEKHAR, Kapil +Parekh, Kenneth Enevoldsen, Kian Eliasi, kostayScr, Krishnan Vignesh, kryggird, +Kyle S, Lakshmi Krishnan, Leomax, Loic Esteve, Luca Bittarello, Lucas Colley, +Lucy Liu, Luigi Giugliano, Luis, Mahdi Abid, Mahi Dhiman, Maitrey Talware, +Mamduh Zabidi, Manikandan Gobalakrishnan, Marc Bresson, Marco Edward Gorelli, +Marek Pokropiński, Maren Westermann, Marie Sacksick, Marija Vlajic, Matt J., +Mayank Raj, Michael Burkhart, Michael Šimáček, Miguel Fernandes, Miro Hrončok, +Mohamed DHIFALLAH, Muhammad Waseem, MUHAMMED SINAN D, Natalia Mokeeva, Nicholas +Farr, Nicolas Bolle, Nicolas Hug, nithish-74, Nithurshen, Nitin Pratap Singh, +NotAceNinja, Olivier Grisel, omahs, Omar Salman, Patrick Walsh, Peter Holzer, +pfolch, ph-ll-pp, Prashant Bansal, Quan H. Nguyen, Radovenchyk, Rafael Ayllón +Gavilán, Raghvender, Ranjodh Singh, Ravichandranayakar, Remi Gau, Reshama +Shaikh, Richard Harris, RishiP2006, Ritvi Alagusankar, Roberto Mourao, Robert +Pollak, Roshangoli, roychan, R Sagar Shresti, Sarthak Puri, saskra, +scikit-learn-bot, Scott Huberty, Sercan Turkmen, Sergio P, Shashank S, Shaurya +Bisht, Shivam, Shruti Nath, SIKAI ZHANG, sisird864, SiyuJin-1, S. M. Mohiuddin +Khan Shiam, Somdutta Banerjee, sotagg, Sota Goto, Spencer Bradkin, Stefan, +Stefanie Senger, Steffen Rehberg, Steven Hur, Success Moses, Sylvain Combettes, +ThibaultDECO, Thomas J. Fan, Thomas Li, Thomas S., Tim Head, Tingwei Zhu, +Tiziano Zito, TJ Norred, Username46786, Utsab Dahal, Vasanth K, Veghit, +VirenPassi, Virgil Chan, Vivaan Nanavati, Xiao Yuan, xuzhang0327, Yaroslav +Halchenko, Yaswanth Kumar, Zijun yi, zodchi94, Zubair Shakoor From 7f0900c265936eac9a89bba37eb19ee66208d46a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Thu, 11 Dec 2025 03:07:51 +0100 Subject: [PATCH 09/19] MNT Update SECURITY.md for 1.8.0 (#32881) --- SECURITY.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 9760e345b3e47..961e8e2e195c4 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,8 +4,8 @@ | Version | Supported | | ------------- | ------------------ | -| 1.7.2 | :white_check_mark: | -| < 1.7.2 | :x: | +| 1.8.0 | :white_check_mark: | +| < 1.8.0 | :x: | ## Reporting a Vulnerability From de3816631818fa905ba14a26c2fa721aa91ffa09 Mon Sep 17 00:00:00 2001 From: Andres Nayeem Mejia <50155815+andresnmejia@users.noreply.github.com> Date: Thu, 11 Dec 2025 21:47:11 -0500 Subject: [PATCH 10/19] Fix typo in cross-validation definition (#32890) --- doc/glossary.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/glossary.rst b/doc/glossary.rst index 1f214a11b7320..2a03332c34f1a 100644 --- a/doc/glossary.rst +++ b/doc/glossary.rst @@ -231,7 +231,7 @@ General Concepts cross validation A resampling method that iteratively partitions data into mutually exclusive 'train' and 'test' subsets so model performance can be - evaluated on unseen data. This conserves data as avoids the need to hold + evaluated on unseen data. This conserves data as it avoids the need to hold out a 'validation' dataset and accounts for variability as multiple rounds of cross validation are generally performed. See :ref:`User Guide ` for more details. From 92fb813359bf27a4abe8ac1caec0d9cad9256959 Mon Sep 17 00:00:00 2001 From: Christian Lorentzen Date: Fri, 12 Dec 2025 10:19:17 +0100 Subject: [PATCH 11/19] FIX activate gap safe screening in MultiTaskElasticNet and MultiTaskLasso (#32842) --- sklearn/linear_model/_coordinate_descent.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sklearn/linear_model/_coordinate_descent.py b/sklearn/linear_model/_coordinate_descent.py index efa5a76adfad5..5fc734c33a078 100644 --- a/sklearn/linear_model/_coordinate_descent.py +++ b/sklearn/linear_model/_coordinate_descent.py @@ -2763,6 +2763,7 @@ def fit(self, X, y): self.tol, check_random_state(self.random_state), random, + do_screening=True, ) # account for different objective scaling here and in cd_fast From b5f8f1c6aadd97a5eb0f76b40f0a797b434b4f0b Mon Sep 17 00:00:00 2001 From: Virgil Chan Date: Fri, 12 Dec 2025 02:58:18 -0800 Subject: [PATCH 12/19] ENH add Array API support for `d2_pinball_score` and `d2_absolute_error_score` (#31671) Co-authored-by: Olivier Grisel --- doc/modules/array_api.rst | 2 + .../array-api/31671.feature.rst | 3 + .../sklearn.metrics/31671.fix.rst | 8 +++ sklearn/metrics/_regression.py | 67 +++++++++---------- sklearn/metrics/tests/test_common.py | 25 +++++++ 5 files changed, 70 insertions(+), 35 deletions(-) create mode 100644 doc/whats_new/upcoming_changes/array-api/31671.feature.rst create mode 100644 doc/whats_new/upcoming_changes/sklearn.metrics/31671.fix.rst diff --git a/doc/modules/array_api.rst b/doc/modules/array_api.rst index 7771cc92f338c..b3cf4dd7476f0 100644 --- a/doc/modules/array_api.rst +++ b/doc/modules/array_api.rst @@ -164,8 +164,10 @@ Metrics - :func:`sklearn.metrics.cluster.calinski_harabasz_score` - :func:`sklearn.metrics.cohen_kappa_score` - :func:`sklearn.metrics.confusion_matrix` +- :func:`sklearn.metrics.d2_absolute_error_score` - :func:`sklearn.metrics.d2_brier_score` - :func:`sklearn.metrics.d2_log_loss_score` +- :func:`sklearn.metrics.d2_pinball_score` - :func:`sklearn.metrics.d2_tweedie_score` - :func:`sklearn.metrics.det_curve` - :func:`sklearn.metrics.explained_variance_score` diff --git a/doc/whats_new/upcoming_changes/array-api/31671.feature.rst b/doc/whats_new/upcoming_changes/array-api/31671.feature.rst new file mode 100644 index 0000000000000..f9d6a6aecb0b0 --- /dev/null +++ b/doc/whats_new/upcoming_changes/array-api/31671.feature.rst @@ -0,0 +1,3 @@ +- :func:`sklearn.metrics.d2_absolute_error_score` and + :func:`sklearn.metrics.d2_pinball_score` now support array API compatible inputs. + By :user:`Virgil Chan `. diff --git a/doc/whats_new/upcoming_changes/sklearn.metrics/31671.fix.rst b/doc/whats_new/upcoming_changes/sklearn.metrics/31671.fix.rst new file mode 100644 index 0000000000000..9bfcd7827bedd --- /dev/null +++ b/doc/whats_new/upcoming_changes/sklearn.metrics/31671.fix.rst @@ -0,0 +1,8 @@ +- :func:`metrics.d2_pinball_score` and :func:`metrics.d2_absolute_error_score` now + always use the `"averaged_inverted_cdf"` quantile method, both with and + without sample weights. Previously, the `"linear"` quantile method was used only + for the unweighted case leading the surprising discrepancies when comparing the + results with unit weights. Note that all quantile interpolation methods are + asymptotically equivalent in the large sample limit, but this fix can cause score + value changes on small evaluation sets (without weights). + By :user:`Virgil Chan `. diff --git a/sklearn/metrics/_regression.py b/sklearn/metrics/_regression.py index 955014484fc5d..855912ca2d4a4 100644 --- a/sklearn/metrics/_regression.py +++ b/sklearn/metrics/_regression.py @@ -936,7 +936,7 @@ def median_absolute_error( return float(_average(output_errors, weights=multioutput, xp=xp)) -def _assemble_r2_explained_variance( +def _assemble_fraction_of_explained_deviance( numerator, denominator, n_outputs, multioutput, force_finite, xp, device ): """Common part used by explained variance score and :math:`R^2` score.""" @@ -1121,7 +1121,7 @@ def explained_variance_score( (y_true - y_true_avg) ** 2, weights=sample_weight, axis=0, xp=xp ) - return _assemble_r2_explained_variance( + return _assemble_fraction_of_explained_deviance( numerator=numerator, denominator=denominator, n_outputs=y_true.shape[1], @@ -1300,7 +1300,7 @@ def r2_score( axis=0, ) - return _assemble_r2_explained_variance( + return _assemble_fraction_of_explained_deviance( numerator=numerator, denominator=denominator, n_outputs=y_true.shape[1], @@ -1779,9 +1779,9 @@ def d2_pinball_score( >>> d2_pinball_score(y_true, y_pred) 0.5 >>> d2_pinball_score(y_true, y_pred, alpha=0.9) - 0.772... + 0.666... >>> d2_pinball_score(y_true, y_pred, alpha=0.1) - -1.045... + -1.999... >>> d2_pinball_score(y_true, y_true, alpha=0.1) 1.0 @@ -1803,9 +1803,14 @@ def d2_pinball_score( >>> grid.best_params_ {'fit_intercept': True} """ - _, y_true, y_pred, sample_weight, multioutput = _check_reg_targets( + xp, _, device_ = get_namespace_and_device( y_true, y_pred, sample_weight, multioutput ) + _, y_true, y_pred, sample_weight, multioutput = ( + _check_reg_targets_with_floating_dtype( + y_true, y_pred, sample_weight, multioutput, xp=xp + ) + ) if _num_samples(y_pred) < 2: msg = "D^2 score is not well-defined with less than two samples." @@ -1821,16 +1826,18 @@ def d2_pinball_score( ) if sample_weight is None: - y_quantile = np.tile( - np.percentile(y_true, q=alpha * 100, axis=0), (len(y_true), 1) - ) - else: - y_quantile = np.tile( - _weighted_percentile( - y_true, sample_weight=sample_weight, percentile_rank=alpha * 100 - ), - (len(y_true), 1), - ) + sample_weight = xp.ones([y_true.shape[0]], dtype=y_true.dtype, device=device_) + + y_quantile = xp.tile( + _weighted_percentile( + y_true, + sample_weight=sample_weight, + percentile_rank=alpha * 100, + average=True, + xp=xp, + ), + (y_true.shape[0], 1), + ) denominator = mean_pinball_loss( y_true, @@ -1840,25 +1847,15 @@ def d2_pinball_score( multioutput="raw_values", ) - nonzero_numerator = numerator != 0 - nonzero_denominator = denominator != 0 - valid_score = nonzero_numerator & nonzero_denominator - output_scores = np.ones(y_true.shape[1]) - - output_scores[valid_score] = 1 - (numerator[valid_score] / denominator[valid_score]) - output_scores[nonzero_numerator & ~nonzero_denominator] = 0.0 - - if isinstance(multioutput, str): - if multioutput == "raw_values": - # return scores individually - return output_scores - else: # multioutput == "uniform_average" - # passing None as weights to np.average results in uniform mean - avg_weights = None - else: - avg_weights = multioutput - - return float(np.average(output_scores, weights=avg_weights)) + return _assemble_fraction_of_explained_deviance( + numerator=numerator, + denominator=denominator, + n_outputs=y_true.shape[1], + multioutput=multioutput, + force_finite=True, + xp=xp, + device=device_, + ) @validate_params( diff --git a/sklearn/metrics/tests/test_common.py b/sklearn/metrics/tests/test_common.py index 34bfbc8b26252..6007a279eedb5 100644 --- a/sklearn/metrics/tests/test_common.py +++ b/sklearn/metrics/tests/test_common.py @@ -148,6 +148,11 @@ "mean_compound_poisson_deviance": partial(mean_tweedie_deviance, power=1.4), "d2_tweedie_score": partial(d2_tweedie_score, power=1.4), "d2_pinball_score": d2_pinball_score, + # The default `alpha=0.5` (median) masks differences between quantile methods, + # so we also test `alpha=0.1` and `alpha=0.9` to ensure correctness + # for non-median quantiles. + "d2_pinball_score_01": partial(d2_pinball_score, alpha=0.1), + "d2_pinball_score_09": partial(d2_pinball_score, alpha=0.9), "d2_absolute_error_score": d2_absolute_error_score, } @@ -492,6 +497,8 @@ def precision_recall_curve_padded_thresholds(*args, **kwargs): "mean_absolute_percentage_error", "mean_pinball_loss", "d2_pinball_score", + "d2_pinball_score_01", + "d2_pinball_score_09", "d2_absolute_error_score", } @@ -563,6 +570,8 @@ def precision_recall_curve_padded_thresholds(*args, **kwargs): "mean_compound_poisson_deviance", "d2_tweedie_score", "d2_pinball_score", + "d2_pinball_score_01", + "d2_pinball_score_09", "d2_absolute_error_score", "mean_absolute_percentage_error", } @@ -2358,6 +2367,22 @@ def check_array_api_metric_pairwise(metric, array_namespace, device, dtype_name) check_array_api_regression_metric, check_array_api_regression_metric_multioutput, ], + d2_absolute_error_score: [ + check_array_api_regression_metric, + check_array_api_regression_metric_multioutput, + ], + d2_pinball_score: [ + check_array_api_regression_metric, + check_array_api_regression_metric_multioutput, + ], + partial(d2_pinball_score, alpha=0.1): [ + check_array_api_regression_metric, + check_array_api_regression_metric_multioutput, + ], + partial(d2_pinball_score, alpha=0.9): [ + check_array_api_regression_metric, + check_array_api_regression_metric_multioutput, + ], d2_tweedie_score: [ check_array_api_regression_metric, ], From 6f7eef1ad439914f7620cc11a0252e023d62ae4a Mon Sep 17 00:00:00 2001 From: Omar Salman Date: Fri, 12 Dec 2025 19:30:10 +0500 Subject: [PATCH 13/19] Reverts the screening refactoring in enet_coordinate_descent_gram (#32860) --- sklearn/linear_model/_cd_fast.pyx | 109 +++++++++++------------------- 1 file changed, 41 insertions(+), 68 deletions(-) diff --git a/sklearn/linear_model/_cd_fast.pyx b/sklearn/linear_model/_cd_fast.pyx index c227100ec066e..5ca5160fcb127 100644 --- a/sklearn/linear_model/_cd_fast.pyx +++ b/sklearn/linear_model/_cd_fast.pyx @@ -914,48 +914,6 @@ cdef (floating, floating) gap_enet_gram( return gap, dual_norm_XtA -cdef inline uint32_t screen_features_enet_gram( - const floating[:, ::1] Q, - const floating[::1] XtA, - floating[::1] w, - floating[::1] Qw, - uint32_t[::1] active_set, - uint8_t[::1] excluded_set, - floating alpha, - floating beta, - floating gap, - floating dual_norm_XtA, - uint32_t n_features, -) noexcept nogil: - """Apply gap safe screening for all features within enet_coordinate_descent_gram""" - cdef floating d_j - cdef floating Xj_theta - cdef uint32_t n_active = 0 - # Due to floating point issues, gap might be negative. - cdef floating radius = sqrt(2 * fabs(gap)) / alpha - - for j in range(n_features): - if Q[j, j] == 0: - w[j] = 0 - excluded_set[j] = 1 - continue - - Xj_theta = XtA[j] / fmax(alpha, dual_norm_XtA) # X[:,j] @ dual_theta - d_j = (1 - fabs(Xj_theta)) / sqrt(Q[j, j] + beta) - if d_j <= radius: - # include feature j - active_set[n_active] = j - excluded_set[j] = 0 - n_active += 1 - else: - # Qw -= w[j] * Q[j] # Update Qw = Q @ w - _axpy(n_features, -w[j], &Q[j, 0], 1, &Qw[0], 1) - w[j] = 0 - excluded_set[j] = 1 - - return n_active - - def enet_coordinate_descent_gram( floating[::1] w, floating alpha, @@ -1007,6 +965,9 @@ def enet_coordinate_descent_gram( cdef floating[::1] XtA = np.zeros(n_features, dtype=dtype) cdef floating y_norm2 = np.dot(y, y) + cdef floating d_j + cdef floating radius + cdef floating Xj_theta cdef floating tmp cdef floating w_j cdef floating d_w_max @@ -1050,19 +1011,26 @@ def enet_coordinate_descent_gram( # Gap Safe Screening Rules, see https://arxiv.org/abs/1802.07481, Eq. 11 if do_screening: - n_active = screen_features_enet_gram( - Q=Q, - XtA=XtA, - w=w, - Qw=Qw, - active_set=active_set, - excluded_set=excluded_set, - alpha=alpha, - beta=beta, - gap=gap, - dual_norm_XtA=dual_norm_XtA, - n_features=n_features, - ) + # Due to floating point issues, gap might be negative. + radius = sqrt(2 * fabs(gap)) / alpha + n_active = 0 + for j in range(n_features): + if Q[j, j] == 0: + w[j] = 0 + excluded_set[j] = 1 + continue + Xj_theta = XtA[j] / fmax(alpha, dual_norm_XtA) # X[:,j] @ dual_theta + d_j = (1 - fabs(Xj_theta)) / sqrt(Q[j, j] + beta) + if d_j <= radius: + # include feature j + active_set[n_active] = j + excluded_set[j] = 0 + n_active += 1 + else: + # Qw -= w[j] * Q[j] # Update Qw = Q @ w + _axpy(n_features, -w[j], &Q[j, 0], 1, &Qw[0], 1) + w[j] = 0 + excluded_set[j] = 1 for n_iter in range(max_iter): w_max = 0.0 @@ -1116,19 +1084,24 @@ def enet_coordinate_descent_gram( # Gap Safe Screening Rules, see https://arxiv.org/abs/1802.07481, Eq. 11 if do_screening: - n_active = screen_features_enet_gram( - Q=Q, - XtA=XtA, - w=w, - Qw=Qw, - active_set=active_set, - excluded_set=excluded_set, - alpha=alpha, - beta=beta, - gap=gap, - dual_norm_XtA=dual_norm_XtA, - n_features=n_features, - ) + # Due to floating point issues, gap might be negative. + radius = sqrt(2 * fabs(gap)) / alpha + n_active = 0 + for j in range(n_features): + if excluded_set[j]: + continue + Xj_theta = XtA[j] / fmax(alpha, dual_norm_XtA) # X @ dual_theta + d_j = (1 - fabs(Xj_theta)) / sqrt(Q[j, j] + beta) + if d_j <= radius: + # include feature j + active_set[n_active] = j + excluded_set[j] = 0 + n_active += 1 + else: + # Qw -= w[j] * Q[j] # Update Qw = Q @ w + _axpy(n_features, -w[j], &Q[j, 0], 1, &Qw[0], 1) + w[j] = 0 + excluded_set[j] = 1 else: # for/else, runs if for doesn't end with a `break` From a1cae3ea26d4703f7eedd79464c18e6825c8f2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dea=20Mar=C3=ADa=20L=C3=A9on?= Date: Fri, 12 Dec 2025 15:39:05 +0100 Subject: [PATCH 14/19] ENH Order user-set parameters before default parameters on HTML Display (#32802) --- sklearn/base.py | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/sklearn/base.py b/sklearn/base.py index b897e5c8f3ea8..2854334450006 100644 --- a/sklearn/base.py +++ b/sklearn/base.py @@ -318,19 +318,30 @@ def is_non_default(param_name, param_value): return False - # reorder the parameters from `self.get_params` using the `__init__` - # signature - remaining_params = [name for name in out if name not in init_default_params] - ordered_out = {name: out[name] for name in init_default_params if name in out} - ordered_out.update({name: out[name] for name in remaining_params}) - - non_default_ls = tuple( - [name for name, value in ordered_out.items() if is_non_default(name, value)] + # Sort parameters so non-default parameters are shown first + unordered_params = { + name: out[name] for name in init_default_params if name in out + } + unordered_params.update( + { + name: value + for name, value in out.items() + if name not in init_default_params + } ) + non_default_params, default_params = [], [] + for name, value in unordered_params.items(): + if is_non_default(name, value): + non_default_params.append(name) + else: + default_params.append(name) + + params = {name: out[name] for name in non_default_params + default_params} + return ParamsDict( - params=ordered_out, - non_default=non_default_ls, + params=params, + non_default=tuple(non_default_params), estimator_class=self.__class__, doc_link=doc_link, ) From c7d040e4f23e7888125de0af52e640329c8b9a5a Mon Sep 17 00:00:00 2001 From: Anne Beyer Date: Sun, 14 Dec 2025 07:50:39 +0100 Subject: [PATCH 15/19] TST make pandas warning message regex more generic (#32895) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lucy Liu Co-authored-by: Loïc Estève --- sklearn/preprocessing/tests/test_target_encoder.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sklearn/preprocessing/tests/test_target_encoder.py b/sklearn/preprocessing/tests/test_target_encoder.py index 84f04ec46f343..fca0df3f16d55 100644 --- a/sklearn/preprocessing/tests/test_target_encoder.py +++ b/sklearn/preprocessing/tests/test_target_encoder.py @@ -721,13 +721,12 @@ def test_pandas_copy_on_write(): else: with warnings.catch_warnings(): expected_message = ( - "Copy-on-Write can no longer be disabled, " - "setting to False has no impact. This option will " - "be removed in pandas 4.0." + ".*Copy-on-Write can no longer be disabled.*This option will" + r" be removed in pandas 4\.0" ) warnings.filterwarnings( "ignore", - message=re.escape(expected_message), + message=expected_message, category=DeprecationWarning, ) with pd.option_context("mode.copy_on_write", True): From 3e4a985d3558eaf5ad91876c41da64a88df41be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dea=20Mar=C3=ADa=20L=C3=A9on?= Date: Mon, 15 Dec 2025 00:34:12 +0100 Subject: [PATCH 16/19] FIX: Tooltip position using CSS anchor positioning (#32887) --- .../upcoming_changes/sklearn.utils/32887.fix.rst | 6 ++++++ sklearn/utils/_repr_html/params.css | 16 ++++++++++++++++ sklearn/utils/_repr_html/params.py | 5 ++++- sklearn/utils/_repr_html/tests/test_params.py | 10 ++++++++-- 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 doc/whats_new/upcoming_changes/sklearn.utils/32887.fix.rst diff --git a/doc/whats_new/upcoming_changes/sklearn.utils/32887.fix.rst b/doc/whats_new/upcoming_changes/sklearn.utils/32887.fix.rst new file mode 100644 index 0000000000000..765e4f62b9a58 --- /dev/null +++ b/doc/whats_new/upcoming_changes/sklearn.utils/32887.fix.rst @@ -0,0 +1,6 @@ +- The parameter table in the HTML representation of all scikit-learn + estimators inheritiging from :class:`base.BaseEstimator`, displays + each parameter documentation as a tooltip. The last tooltip of a + parameter in the last table of any HTML representation was partially hidden. + This issue has been fixed. + By :user:`Dea María Léon ` diff --git a/sklearn/utils/_repr_html/params.css b/sklearn/utils/_repr_html/params.css index 10d1a0a79a68b..c20acdd8d243c 100644 --- a/sklearn/utils/_repr_html/params.css +++ b/sklearn/utils/_repr_html/params.css @@ -83,6 +83,14 @@ a.param-doc-link:visited { padding: .5em; } +@supports(anchor-name: --doc-link) { + a.param-doc-link, + a.param-doc-link:link, + a.param-doc-link:visited { + anchor-name: --doc-link; + } +} + /* "hack" to make the entire area of the cell containing the link clickable */ a.param-doc-link::before { position: absolute; @@ -109,6 +117,14 @@ a.param-doc-link::before { border: thin solid var(--sklearn-color-unfitted-level-3); } +@supports(position-area: center right) { + .param-doc-description { + position-area: center right; + position: fixed; + margin-left: 0; + } +} + /* Fitted state for parameter tooltips */ .fitted .param-doc-description { /* fitted */ diff --git a/sklearn/utils/_repr_html/params.py b/sklearn/utils/_repr_html/params.py index 011dde246198d..2bc523f7d6e17 100644 --- a/sklearn/utils/_repr_html/params.py +++ b/sklearn/utils/_repr_html/params.py @@ -89,9 +89,12 @@ def _params_html_repr(params): PARAM_AVAILABLE_DOC_LINK_TEMPLATE = """ {param_name} - {param_description} + + {param_description} """ estimator_class_docs = inspect.getdoc(params.estimator_class) diff --git a/sklearn/utils/_repr_html/tests/test_params.py b/sklearn/utils/_repr_html/tests/test_params.py index a2fe8d54c0a6d..4cbd1302ee2dd 100644 --- a/sklearn/utils/_repr_html/tests/test_params.py +++ b/sklearn/utils/_repr_html/tests/test_params.py @@ -108,10 +108,13 @@ class MockEstimator: html_param_a = ( r'' r'\s*' r"\s*a" - r'\s*a: int

' + r'\s*\s*a:' + r"\sint

" r"Description of a\.
" r"\s*
" r"\s*" @@ -120,10 +123,13 @@ class MockEstimator: html_param_b = ( r'' r'.*' r"\s*b" - r'\s*b: str

' + r'\s*\s*b:' + r"\sstr

" r"\s*
" r"\s*" ) From 9db90d21440d1712fb073761547b68ae1f98b3a0 Mon Sep 17 00:00:00 2001 From: Lucy Liu Date: Mon, 15 Dec 2025 22:50:36 +1100 Subject: [PATCH 17/19] TST Add `confusion_matrix_at_thresholds` to common tests (#32883) --- sklearn/metrics/tests/test_common.py | 61 ++++++++++++++++++---------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/sklearn/metrics/tests/test_common.py b/sklearn/metrics/tests/test_common.py index 6007a279eedb5..6beb495af194b 100644 --- a/sklearn/metrics/tests/test_common.py +++ b/sklearn/metrics/tests/test_common.py @@ -18,6 +18,7 @@ classification_report, cohen_kappa_score, confusion_matrix, + confusion_matrix_at_thresholds, coverage_error, d2_absolute_error_score, d2_brier_score, @@ -161,17 +162,13 @@ "balanced_accuracy_score": balanced_accuracy_score, "adjusted_balanced_accuracy_score": partial(balanced_accuracy_score, adjusted=True), "unnormalized_accuracy_score": partial(accuracy_score, normalize=False), - # `confusion_matrix` returns absolute values and hence behaves unnormalized - # . Naming it with an unnormalized_ prefix is necessary for this module to - # skip sample_weight scaling checks which will fail for unnormalized - # metrics. - "unnormalized_confusion_matrix": confusion_matrix, + "confusion_matrix": confusion_matrix, "normalized_confusion_matrix": lambda *args, **kwargs: ( confusion_matrix(*args, **kwargs).astype("float") / confusion_matrix(*args, **kwargs).sum(axis=1)[:, np.newaxis] ), - "unnormalized_multilabel_confusion_matrix": multilabel_confusion_matrix, - "unnormalized_multilabel_confusion_matrix_sample": partial( + "multilabel_confusion_matrix": multilabel_confusion_matrix, + "multilabel_confusion_matrix_sample": partial( multilabel_confusion_matrix, samplewise=True ), "hamming_loss": hamming_loss, @@ -245,6 +242,7 @@ def precision_recall_curve_padded_thresholds(*args, **kwargs): CURVE_METRICS = { + "confusion_matrix_at_thresholds": confusion_matrix_at_thresholds, "roc_curve": roc_curve, "precision_recall_curve": precision_recall_curve_padded_thresholds, "det_curve": det_curve, @@ -310,7 +308,7 @@ def precision_recall_curve_padded_thresholds(*args, **kwargs): "samples_recall_score", "samples_jaccard_score", "coverage_error", - "unnormalized_multilabel_confusion_matrix_sample", + "multilabel_confusion_matrix_sample", "label_ranking_loss", "label_ranking_average_precision_score", "dcg_score", @@ -332,6 +330,7 @@ def precision_recall_curve_padded_thresholds(*args, **kwargs): "f2_score", "f0.5_score", # curves + "confusion_matrix_at_thresholds", "roc_curve", "precision_recall_curve", "det_curve", @@ -361,6 +360,7 @@ def precision_recall_curve_padded_thresholds(*args, **kwargs): # Metrics with a "pos_label" argument METRICS_WITH_POS_LABEL = { + "confusion_matrix_at_thresholds", "roc_curve", "precision_recall_curve", "det_curve", @@ -382,7 +382,7 @@ def precision_recall_curve_padded_thresholds(*args, **kwargs): # TODO: Handle multi_class metrics that has a labels argument as well as a # decision function argument. e.g hinge_loss METRICS_WITH_LABELS = { - "unnormalized_confusion_matrix", + "confusion_matrix", "normalized_confusion_matrix", "roc_curve", "precision_recall_curve", @@ -411,8 +411,8 @@ def precision_recall_curve_padded_thresholds(*args, **kwargs): "macro_precision_score", "macro_recall_score", "macro_jaccard_score", - "unnormalized_multilabel_confusion_matrix", - "unnormalized_multilabel_confusion_matrix_sample", + "multilabel_confusion_matrix", + "multilabel_confusion_matrix_sample", "cohen_kappa_score", "log_loss", "d2_log_loss_score", @@ -475,7 +475,7 @@ def precision_recall_curve_padded_thresholds(*args, **kwargs): "micro_precision_score", "micro_recall_score", "micro_jaccard_score", - "unnormalized_multilabel_confusion_matrix", + "multilabel_confusion_matrix", "samples_f0.5_score", "samples_f1_score", "samples_f2_score", @@ -545,8 +545,9 @@ def precision_recall_curve_padded_thresholds(*args, **kwargs): "adjusted_balanced_accuracy_score", "explained_variance_score", "r2_score", - "unnormalized_confusion_matrix", + "confusion_matrix", "normalized_confusion_matrix", + "confusion_matrix_at_thresholds", "roc_curve", "precision_recall_curve", "det_curve", @@ -559,7 +560,7 @@ def precision_recall_curve_padded_thresholds(*args, **kwargs): "weighted_f2_score", "weighted_precision_score", "weighted_jaccard_score", - "unnormalized_multilabel_confusion_matrix", + "multilabel_confusion_matrix", "macro_f0.5_score", "macro_f2_score", "macro_precision_score", @@ -584,6 +585,19 @@ def precision_recall_curve_padded_thresholds(*args, **kwargs): "weighted_ovo_roc_auc", } +WEIGHT_SCALE_DEPENDENT_METRICS = { + # 'confusion_matrix' metrics returns absolute `tps`, `fps` etc values, which + # are scaled by weights, so will vary e.g., scaling by 3 will result in 3 * `tps` + "confusion_matrix", + "confusion_matrix_at_thresholds", + "multilabel_confusion_matrix", + "multilabel_confusion_matrix_sample", + # Metrics where we set `normalize=False` + "unnormalized_accuracy_score", + "unnormalized_zero_one_loss", + "unnormalized_log_loss", +} + METRICS_REQUIRE_POSITIVE_Y = { "mean_poisson_deviance", "mean_gamma_deviance", @@ -1621,12 +1635,15 @@ def check_sample_weight_invariance(name, metric, y1, y2, sample_weight=None): % (weighted_score_zeroed, weighted_score_subset, name), ) - if not name.startswith("unnormalized"): - # check that the score is invariant under scaling of the weights by a - # common factor - # Due to numerical instability of floating points in `cumulative_sum` in - # `median_absolute_error`, it is not always equivalent when scaling by a float. - scaling_values = [2] if name == "median_absolute_error" else [2, 0.3] + # Check the score is invariant under scaling of weights by a constant factor + if name not in WEIGHT_SCALE_DEPENDENT_METRICS: + # Numerical instability of floating points in `cumulative_sum` in + # `median_absolute_error`, and in `diff` when in calculating collinear points + # and points in between to drop `roc_curve` means they are not always + # equivalent when scaling by a float. + scaling_values = ( + [2] if name in {"median_absolute_error", "roc_curve"} else [2, 0.3] + ) for scaling in scaling_values: assert_allclose( weighted_score, @@ -1724,7 +1741,7 @@ def test_binary_sample_weight_invariance(name): y_pred = random_state.randint(0, 2, size=(n_samples,)) y_score = random_state.random_sample(size=(n_samples,)) metric = ALL_METRICS[name] - if name in CONTINUOUS_CLASSIFICATION_METRICS: + if name in (CONTINUOUS_CLASSIFICATION_METRICS | CURVE_METRICS.keys()): check_sample_weight_invariance(name, metric, y_true, y_score) else: check_sample_weight_invariance(name, metric, y_true, y_pred) @@ -1825,7 +1842,7 @@ def test_no_averaging_labels(): @pytest.mark.parametrize( - "name", sorted(MULTILABELS_METRICS - {"unnormalized_multilabel_confusion_matrix"}) + "name", sorted(MULTILABELS_METRICS - {"multilabel_confusion_matrix"}) ) def test_multilabel_label_permutations_invariance(name): random_state = check_random_state(0) From e4610c6ec809523d64ead99d68bba61d82be5167 Mon Sep 17 00:00:00 2001 From: Anne Beyer Date: Mon, 15 Dec 2025 15:11:13 +0100 Subject: [PATCH 18/19] ENH add clearer error message when instance is passed instead of class (#32888) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jérémie du Boisberranger Co-authored-by: Adrin Jalali --- .../many-modules/32888.enhancement.rst | 4 ++++ sklearn/compose/_column_transformer.py | 1 + .../compose/tests/test_column_transformer.py | 17 +++++++++++++++ sklearn/pipeline.py | 2 ++ sklearn/tests/test_pipeline.py | 21 +++++++++++++++++++ sklearn/utils/metaestimators.py | 8 +++++++ 6 files changed, 53 insertions(+) create mode 100644 doc/whats_new/upcoming_changes/many-modules/32888.enhancement.rst diff --git a/doc/whats_new/upcoming_changes/many-modules/32888.enhancement.rst b/doc/whats_new/upcoming_changes/many-modules/32888.enhancement.rst new file mode 100644 index 0000000000000..09247f7d02ee7 --- /dev/null +++ b/doc/whats_new/upcoming_changes/many-modules/32888.enhancement.rst @@ -0,0 +1,4 @@ +- :class:`pipeline.Pipeline`, :class:`pipeline.FeatureUnion` and + :class:`compose.ColumnTransformer` now raise a clearer + error message when an estimator class is passed instead of an instance. + By :user:`Anne Beyer ` diff --git a/sklearn/compose/_column_transformer.py b/sklearn/compose/_column_transformer.py index e2c196f84d313..00986f7cf1c1f 100644 --- a/sklearn/compose/_column_transformer.py +++ b/sklearn/compose/_column_transformer.py @@ -513,6 +513,7 @@ def _validate_transformers(self): self._validate_names(names) # validate estimators + self._check_estimators_are_instances(transformers) for t in transformers: if t in ("drop", "passthrough"): continue diff --git a/sklearn/compose/tests/test_column_transformer.py b/sklearn/compose/tests/test_column_transformer.py index a4c9ba38f460b..7a6f243c14a92 100644 --- a/sklearn/compose/tests/test_column_transformer.py +++ b/sklearn/compose/tests/test_column_transformer.py @@ -93,6 +93,23 @@ def transform(self, X, y=None): raise ValueError("specific message") +@pytest.mark.parametrize( + "transformers", + [ + [("trans1", Trans, [0]), ("trans2", Trans(), [1])], + [("trans1", Trans(), [0]), ("trans2", Trans, [1])], + [("drop", "drop", [0]), ("trans2", Trans, [1])], + [("trans1", Trans, [0]), ("passthrough", "passthrough", [1])], + ], +) +def test_column_transformer_raises_class_not_instance_error(transformers): + # non-regression tests for https://github.com/scikit-learn/scikit-learn/issues/32719 + ct = ColumnTransformer(transformers) + msg = "Expected an estimator instance (.*()), got estimator class instead (.*)." + with pytest.raises(TypeError, match=msg): + ct.fit([[1]]) + + def test_column_transformer(): X_array = np.array([[0, 1, 2], [2, 4, 6]]).T diff --git a/sklearn/pipeline.py b/sklearn/pipeline.py index c0652840ff862..32dc4dd187d84 100644 --- a/sklearn/pipeline.py +++ b/sklearn/pipeline.py @@ -296,6 +296,7 @@ def _validate_steps(self): self._validate_names(names) # validate estimators + self._check_estimators_are_instances(estimators) transformers = estimators[:-1] estimator = estimators[-1] @@ -1698,6 +1699,7 @@ def _validate_transformers(self): self._validate_names(names) # validate estimators + self._check_estimators_are_instances(transformers) for t in transformers: if t in ("drop", "passthrough"): continue diff --git a/sklearn/tests/test_pipeline.py b/sklearn/tests/test_pipeline.py index b2eb7deb4a712..00bddae53d34e 100644 --- a/sklearn/tests/test_pipeline.py +++ b/sklearn/tests/test_pipeline.py @@ -282,6 +282,27 @@ def test_pipeline_invalid_parameters(): assert params == params2 +@pytest.mark.parametrize( + "meta_estimators", + [ + Pipeline([("pca", PCA)]), + Pipeline([("pca", PCA), ("ident", None)]), + Pipeline([("passthrough", "passthrough"), ("pca", PCA)]), + Pipeline([("passthrough", None), ("pca", PCA)]), + Pipeline([("scale", StandardScaler), ("pca", PCA())]), + FeatureUnion([("pca", PCA), ("svd", TruncatedSVD())]), + FeatureUnion([("pca", PCA()), ("svd", TruncatedSVD)]), + FeatureUnion([("drop", "drop"), ("svd", TruncatedSVD)]), + FeatureUnion([("pca", PCA), ("passthrough", "passthrough")]), + ], +) +def test_meta_estimator_raises_class_not_instance_error(meta_estimators): + # non-regression tests for https://github.com/scikit-learn/scikit-learn/issues/32719 + msg = "Expected an estimator instance (.*()), got estimator class instead (.*)." + with pytest.raises(TypeError, match=msg): + meta_estimators.fit([[1]]) + + def test_empty_pipeline(): X = iris.data y = iris.target diff --git a/sklearn/utils/metaestimators.py b/sklearn/utils/metaestimators.py index 1674972772b67..5f2a38f16f96d 100644 --- a/sklearn/utils/metaestimators.py +++ b/sklearn/utils/metaestimators.py @@ -100,6 +100,14 @@ def _validate_names(self, names): "Estimator names must not contain __: got {0!r}".format(invalid_names) ) + def _check_estimators_are_instances(self, estimators): + for estimator in estimators: + if isinstance(estimator, type): + raise TypeError( + "Expected an estimator instance ({estimator.__name__}()), got " + "estimator class instead ({estimator.__name__})." + ) + def _safe_split(estimator, X, y, indices, train_indices=None): """Create subset of dataset and properly handle kernels. From 895ffbf0d44569b6c5895fdd05c943ddfb1cc6b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dea=20Mar=C3=ADa=20L=C3=A9on?= Date: Tue, 16 Dec 2025 10:55:35 +0100 Subject: [PATCH 19/19] MNT Remove `unnasign.yml` file to avoid automatic `help wanted` label (#32905) --- .github/workflows/unassign.yml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .github/workflows/unassign.yml diff --git a/.github/workflows/unassign.yml b/.github/workflows/unassign.yml deleted file mode 100644 index 94a50d49839d6..0000000000000 --- a/.github/workflows/unassign.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Unassign -#Runs when a contributor has unassigned themselves from the issue and adds 'help wanted' -on: - issues: - types: unassigned - -# Restrict the permissions granted to the use of secrets.GITHUB_TOKEN in this -# github actions workflow: -# https://docs.github.com/en/actions/security-guides/automatic-token-authentication -permissions: - issues: write - -jobs: - one: - runs-on: ubuntu-latest - steps: - - name: - if: github.event.issue.state == 'open' - run: | - echo "Marking issue ${{ github.event.issue.number }} as help wanted" - gh issue edit $ISSUE --add-label "help wanted" - env: - GH_TOKEN: ${{ github.token }} - ISSUE: ${{ github.event.issue.html_url }}