Skip to content

Commit

Permalink
Merge branch 'scikit-learn:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
virchan authored Jun 14, 2024
2 parents a643556 + dc1cad2 commit 18d959f
Show file tree
Hide file tree
Showing 381 changed files with 691 additions and 523 deletions.
2 changes: 1 addition & 1 deletion benchmarks/bench_covertype.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

# Author: Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Arnaud Joly <arnaud.v.joly@gmail.com>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import argparse
import os
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/bench_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

# Author: Issam H. Laradji
# Arnaud Joly <arnaud.v.joly@gmail.com>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import argparse
import os
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/bench_plot_nmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Authors: Tom Dupre la Tour (benchmark)
# Chih-Jen Linn (original projected gradient NMF implementation)
# Anthony Di Franco (projected gradient, Python and NumPy port)
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import numbers
import sys
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/bench_plot_parallel_pairwise.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause
import time

import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/bench_plot_polynomial_kernel_approximation.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"""

# Author: Daniel Lopez-Sanchez <lope@usal.es>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

# Load data manipulation functions
# Will use this for timing results
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/bench_rcv1_logreg_convergence.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Authors: Tom Dupre la Tour <tom.dupre-la-tour@m4x.org>
# Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import gc
import time
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/bench_sgd_regression.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Author: Peter Prettenhofer <peter.prettenhofer@gmail.com>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import gc
from time import time
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/bench_tsne_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import argparse
import json
Expand Down
4 changes: 4 additions & 0 deletions doc/modules/array_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,15 @@ base estimator also does:
Metrics
-------

- :func:`sklearn.metrics.cluster.entropy`
- :func:`sklearn.metrics.accuracy_score`
- :func:`sklearn.metrics.d2_tweedie_score`
- :func:`sklearn.metrics.max_error`
- :func:`sklearn.metrics.mean_absolute_error`
- :func:`sklearn.metrics.mean_gamma_deviance`
- :func:`sklearn.metrics.mean_squared_error`
- :func:`sklearn.metrics.mean_tweedie_deviance`
- :func:`sklearn.metrics.pairwise.additive_chi2_kernel`
- :func:`sklearn.metrics.pairwise.cosine_similarity`
- :func:`sklearn.metrics.pairwise.paired_cosine_distances`
- :func:`sklearn.metrics.r2_score`
Expand Down
6 changes: 6 additions & 0 deletions doc/whats_new/v1.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ Version 1.5.1
Changelog
---------

Changes impacting many modules
------------------------------

- |Fix| Fixed a regression causing a dead-lock at import time in some settings.
:pr:`29235` by :user:`Jérémie du Boisberranger <jeremiedbb>`.

:mod:`sklearn.metrics`
......................

Expand Down
7 changes: 5 additions & 2 deletions doc/whats_new/v1.6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ See :ref:`array_api` for more details.

**Functions:**

- :func:`sklearn.metrics.cluster.entropy` :pr:`29141` by :user:`Yaroslav Korobko <Tialo>`;
- :func:`sklearn.metrics.d2_tweedie_score` :pr:`29207` by :user:`Emily Chen <EmilyXinyi>`;
- :func:`sklearn.metrics.max_error` :pr:`29212` by :user:`Edoardo Abati <EdAbati>`;
- :func:`sklearn.metrics.mean_absolute_error` :pr:`27736` by :user:`Edoardo Abati <EdAbati>`;
- :func:`sklearn.metrics.mean_gamma_deviance` :pr:`29239` by :usser:`Emily Chen <EmilyXinyi>`;
- :func:`sklearn.metrics.mean_squared_error` :pr:`29142` by :user:`Yaroslav Korobko <Tialo>`;
- :func:`sklearn.metrics.mean_tweedie_deviance` :pr:`28106` by :user:`Thomas Li <lithomas1>`;
- :func:`sklearn.metrics.pairwise.cosine_similarity` :pr:`29014` by :user:`Edoardo Abati <EdAbati>`.
- :func:`sklearn.metrics.pairwise.additive_chi2_kernel` :pr:`29144` by :user:`Yaroslav Korobko <Tialo>`;
- :func:`sklearn.metrics.pairwise.cosine_similarity` :pr:`29014` by :user:`Edoardo Abati <EdAbati>`;
- :func:`sklearn.metrics.pairwise.paired_cosine_distances` :pr:`29112` by :user:`Edoardo Abati <EdAbati>`.


**Classes:**

- :class:`preprocessing.LabelEncoder` now supports Array API compatible inputs.
Expand Down
2 changes: 1 addition & 1 deletion examples/applications/plot_model_complexity_influence.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# Authors: Eustache Diemert <eustache@diemert.fr>
# Maria Telenczuk <https://github.com/maikia>
# Guillaume Lemaitre <g.lemaitre58@gmail.com>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import time

Expand Down
2 changes: 1 addition & 1 deletion examples/applications/plot_out_of_core_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# Authors: Eustache Diemert <eustache@diemert.fr>
# @FedericoV <https://github.com/FedericoV/>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import itertools
import re
Expand Down
2 changes: 1 addition & 1 deletion examples/applications/plot_outlier_detection_wine.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"""

# Author: Virgile Fritsch <virgile.fritsch@inria.fr>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

# %%
# First example
Expand Down
2 changes: 1 addition & 1 deletion examples/applications/plot_prediction_latency.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"""

# Authors: Eustache Diemert <eustache@diemert.fr>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import gc
import time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Jake Vanderplas <vanderplas@astro.washington.edu>
#
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

from time import time

Expand Down
2 changes: 1 addition & 1 deletion examples/applications/plot_stock_market.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

# Author: Gael Varoquaux gael.varoquaux@normalesup.org
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

# %%
# Retrieve the data from Internet
Expand Down
2 changes: 1 addition & 1 deletion examples/applications/plot_tomography_l1_reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class :class:`~sklearn.linear_model.Lasso`, that uses the coordinate descent
"""

# Author: Emmanuelle Gouillart <emmanuelle.gouillart@nsup.org>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import matplotlib.pyplot as plt
import numpy as np
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# Author: Olivier Grisel <olivier.grisel@ensta.org>
# Lars Buitinck
# Chyi-Kwei Yau <chyikwei.yau@gmail.com>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

from time import time

Expand Down
2 changes: 1 addition & 1 deletion examples/applications/wikipedia_principal_eigenvector.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"""

# Author: Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import os
from bz2 import BZ2File
Expand Down
2 changes: 1 addition & 1 deletion examples/bicluster/plot_spectral_biclustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"""

# Author: Kemal Eren <kemal@kemaleren.com>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

# %%
# Generate sample data
Expand Down
2 changes: 1 addition & 1 deletion examples/bicluster/plot_spectral_coclustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"""

# Author: Kemal Eren <kemal@kemaleren.com>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import numpy as np
from matplotlib import pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion examples/calibration/plot_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Balazs Kegl <balazs.kegl@gmail.com>
# Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# License: BSD Style.
# SPDX-License-Identifier: BSD-3-Clause

# %%
# Generate synthetic dataset
Expand Down
2 changes: 1 addition & 1 deletion examples/calibration/plot_calibration_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# License: BSD 3 clause.
# SPDX-License-Identifier: BSD-3-Clause
# %%
# Dataset
# -------
Expand Down
2 changes: 1 addition & 1 deletion examples/calibration/plot_calibration_multiclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class of an instance (red: class 1, green: class 2, blue: class 3).
# the classifier but not calibrate the predicted probabilities.

# Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# License: BSD Style.
# SPDX-License-Identifier: BSD-3-Clause

import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion examples/calibration/plot_compare_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# %%
# Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# License: BSD 3 clause.
# SPDX-License-Identifier: BSD-3-Clause
#
# Dataset
# -------
Expand Down
2 changes: 1 addition & 1 deletion examples/classification/plot_classification_probability.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"""

# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import matplotlib.pyplot as plt
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion examples/classification/plot_classifier_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# Code source: Gaël Varoquaux
# Andreas Müller
# Modified for documentation by Jaques Grobler
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import matplotlib.pyplot as plt
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion examples/classification/plot_digits_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"""

# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

# Standard scientific Python imports
import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_adjusted_for_chance_measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# Author: Olivier Grisel <olivier.grisel@ensta.org>
# Arturo Amor <david-arturo.amor-quiroz@inria.fr>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

# %%
# Defining the list of metrics to evaluate
Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_agglomerative_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"""

# Authors: Gael Varoquaux, Nelle Varoquaux
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import time

Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_agglomerative_clustering_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"""

# Author: Gael Varoquaux
# License: BSD 3-Clause or CC-0
# SPDX-License-Identifier: BSD-3-Clause

import matplotlib.patheffects as PathEffects
import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_agglomerative_dendrogram.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Authors: Mathew Kallada, Andreas Mueller
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause
"""
=========================================
Plot Hierarchical Clustering Dendrogram
Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_birch_vs_minibatchkmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

# Authors: Manoj Kumar <manojkumarsivaraj334@gmail.com
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

from itertools import cycle
from time import time
Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_cluster_iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

# Code source: Gaël Varoquaux
# Modified for documentation by Jaques Grobler
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import matplotlib.pyplot as plt

Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_coin_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Brian Cheung
# Andrew Knyazev <Andrew.Knyazev@ucdenver.edu>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import time

Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_coin_ward_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# Author : Vincent Michel, 2010
# Alexandre Gramfort, 2011
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

# %%
# Generate data
Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_color_quantization.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
#
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

from time import time

Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_digits_agglomeration.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

# Code source: Gaël Varoquaux
# Modified for documentation by Jaques Grobler
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

import matplotlib.pyplot as plt
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_digits_linkage.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"""

# Authors: Gael Varoquaux
# License: BSD 3 clause (C) INRIA 2014
# SPDX-License-Identifier: BSD-3-Clause

from time import time

Expand Down
2 changes: 1 addition & 1 deletion examples/cluster/plot_face_compress.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Authors: Gael Varoquaux
# Jaques Grobler
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

# %%
# Original image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""

# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
# SPDX-License-Identifier: BSD-3-Clause

# %%
import shutil
Expand Down
Loading

0 comments on commit 18d959f

Please sign in to comment.