8000 Merge remote-tracking branch 'upstream/main' into pr/jeremiedbb/25493 · jeremiedbb/scikit-learn@f070f21 · GitHub
[go: up one dir, main page]

Skip to content

Commit f070f21

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pr/jeremiedbb/25493
2 parents fd88b7b + d590146 commit f070f21

File tree

96 files changed

+1559
-1253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1559
-1253
lines changed

doc/developers/maintainer.rst

Lines changed: 70 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ Before a release
1717

1818
1. Update authors table:
1919

20+
Create a `classic token on GitHub <https://github.com/settings/tokens/new>`_
21+
with the ``read:org`` following permission.
22+
23+
Run the following script, entering the token in:
24+
2025
.. prompt:: bash $
2126

2227
cd build_tools; make authors; cd ..
@@ -43,14 +48,16 @@ Before a release
4348

4449
**Permissions**
4550

46-
The release manager requires a set of permissions on top of the usual
47-
permissions given to maintainers, which includes:
51+
The release manager must be a *maintainer* of the ``scikit-learn/scikit-learn``
52+
repository to be able to publish on ``pypi.org`` and ``test.pypi.org``
53+
(via a manual trigger of a dedicated Github Actions workflow).
54+
55+
The release manager does not need extra permissions on ``pypi.org`` to publish a
56+
release in particular.
4857

49-
- *maintainer* role on ``scikit-learn`` projects on ``pypi.org`` and
50-
``test.pypi.org``, separately.
51-
- become a member of the *scikit-learn* team on conda-forge by editing the
52-
``recipe/meta.yaml`` file on
53-
``https://github.com/conda-forge/scikit-learn-feedstock``
58+
The release manager must be a *maintainer* of the ``conda-forge/scikit-learn-feedstock``
59+
repository. This can be changed by editing the ``recipe/meta.yaml`` file in the
60+
first release pull-request.
5461

5562
.. _preparing_a_release_pr:
5663

@@ -107,34 +114,74 @@ under the ``doc/whats_new/`` folder so PRs that target the next version can
107114
contribute their changelog entries to this file in parallel to the release
108115
process.
109116

110-
Minor version release
111-
~~~~~~~~~~~~~~~~~~~~~
117+
Minor version release (also known as bug-fix release)
118+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112119

113120
The minor releases should include bug fixes and some relevant documentation
114121
changes only. Any PR resulting in a behavior change which is not a bug fix
115-
should be excluded.
122+
should be excluded. As an example, instructions are given for the `1.2.2` release.
123+
124+
- Create a branch, **on your own fork** (here referred to as `fork`) for the release
125+
from `upstream/main`.
126+
127+
.. prompt:: bash $
128+
129+
git fetch upstream/main
130+
git checkout -b release-1.2.2 upstream/main
131+
git push -u fork release-1.2.2:release-1.2.2
132+
133+
- Create a **draft** PR to the `upstream/1.2.X` branch (not to `upstream/main`)
134+
with all the desired changes.
135+
136+
- Do not push anything on that branch yet.
116137

117-
First, create a branch, **on your own fork** (to release e.g. `0.99.3`):
138+
- Locally rebase `release-1.2.2` from the `upstream/1.2.X` branch using:
118139

119-
.. prompt:: bash $
140+
.. prompt:: bash $
120141

121-
# assuming main and upstream/main are the same
122-
git checkout -b release-0.99.3 main
142+
git rebase -i upstream/1.2.X
123143

124-
Then, create a PR **to the** `scikit-learn/0.99.X` **branch** (not to
125-
main!) with all the desired changes:
144+
This will open an interactive rebase with the `git-rebase-todo` containing all
145+
the latest commit on `main`. At this stage, you have to perform
146+
this interactive rebase with at least someone else (being three people rebasing
147+
is better not to forget something and to avoid any doubt).
126148

127-
.. prompt:: bash $
149+
- **Do not remove lines but drop commit by replace** ``pick`` **with** ``drop``
150+
151+
- Commits to pick for bug-fix release *generally* are prefixed with: `FIX`, `CI`,
152+
`DOC`. They should at least include all the commits of the merged PRs
153+
that were milestoned for this release on GitHub and/or documented as such in
154+
the changelog. It's likely that some bugfixes were documented in the
155+
changelog of the main major release instead of the next bugfix release,
156+
in which case, the matching changelog entries will need to be moved,
157+
first in the `main` branch then backported in the release PR.
158+
159+
- Commits to drop for bug-fix release *generally* are prefixed with: `FEAT`,
160+
`MAINT`, `ENH`, `API`. Reasons for not including them is to prevent change of
161+
behavior (which only must feature in breaking or major releases).
162+
163+
- After having dropped or picked commit, **do no exit** but paste the content
164+
of the `git-rebase-todo` message in the PR.
165+
This file is located at `.git/rebase-merge/git-rebase-todo`.
166+
167+
- Save and exit, starting the interactive rebase.
168+
169+
- Resolve merge conflicts when they happen.
170+
171+
- Force push the result of the rebase and the extra release commits to the release PR:
172+
173+
.. prompt:: bash $
128174

129-
git rebase -i upstream/0.99.2
175+
git push -f fork release-1.2.2:release-1.2.2
130176

131-
Copy the :ref:`release_checklist` templates in the description of the Pull
132-
Request to track progress.
177+
- Copy the :ref:`release_checklist` template and paste it in the description of the
178+
Pull Request to track progress.
133179

134-
Do not forget to add a commit updating ``sklearn.__version__``.
180+
- Review all the commits included in the release to make sure that they do not
181+
introduce any new feature. We should not blindly trust the commit message prefixes.
135182

136-
It's nice to have a copy of the ``git rebase -i`` log in the PR to help others
137-
understand what's included.
183+
- Remove the draft status of the release PR and invite other maintainers to review the
184+
list of included commits.
138185

139186
.. _making_a_release:
140187

doc/modules/neighbors.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,13 @@ have the same interface; we'll show an example of using the KD Tree here:
136136
Refer to the :class:`KDTree` and :class:`BallTree` class documentation
137137
for more information on the options available for nearest neighbors searches,
138138
including specification of query strategies, distance metrics, etc. For a list
139-
of available metrics, see the documentation of the :class:`DistanceMetric` class
140-
and the metrics listed in `sklearn.metrics.pairwise.PAIRWISE_DISTANCE_FUNCTIONS`.
141-
Note that the "cosine" metric uses :func:`~sklearn.metrics.pairwise.cosine_distances`.
139+
of valid metrics use :meth:`KDTree.valid_metrics` and :meth:`BallTree.valid_metrics`:
140+
141+
>>> from sklearn.neighbors import KDTree, BallTree
142+
>>> KDTree.valid_metrics()
143+
['euclidean', 'l2', 'minkowski', 'p', 'manhattan', 'cityblock', 'l1', 'chebyshev', 'infinity']
144+
>>> BallTree.valid_metrics()
145+
['euclidean', 'l2', 'minkowski', 'p', 'manhattan', 'cityblock', 'l1', 'chebyshev', 'infinity', 'seuclidean', 'mahalanobis', 'wminkowski', 'hamming', 'canberra', 'braycurtis', 'matching', 'jaccard', 'dice', 'rogerstanimoto', 'russellrao', 'sokalmichener', 'sokalsneath', 'haversine', 'pyfunc']
142146

143147
.. _classification:
144148

@@ -476,7 +480,7 @@ A list of valid metrics for any of the above algorithms can be obtained by using
476480
``valid_metric`` attribute. For example, valid metrics for ``KDTree`` can be generated by:
477481

478482
>>> from sklearn.neighbors import KDTree
479-
>>> print(sorted(KDTree.valid_metrics))
483+
>>> print(sorted(KDTree.valid_metrics()))
480484
['chebyshev', 'cityblock', 'euclidean', 'infinity', 'l1', 'l2', 'manhattan', 'minkowski', 'p']
481485

482486

doc/themes/scikit-learn-modern/nav.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
('Support', pathto('support'), ''),
2828
('Related packages', pathto('related_projects'), ''),
2929
('Roadmap', pathto('roadmap'), ''),
30+
('Governance', pathto('governance'), ''),
3031
('About us', pathto('about'), ''),
3132
('GitHub', 'https://github.com/scikit-learn/scikit-learn', ''),
3233
('Other Versions and Download', 'https://scikit-learn.org/dev/versions.html', '')]

doc/whats_new/v1.2.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,36 @@ Changes impacting all modules
2727
Changelog
2828
---------
2929

30+
:mod:`sklearn.calibration`
31+
..........................
32+
33+
- |Fix| A deprecation warning is raised when using the `base_estimator__` prefix
34+
to set parameters of the estimator used in :class:`calibration.CalibratedClassifierCV`.
35+
:pr:`25477` by :user:`Tim Head <betatim>`.
36+
3037
:mod:`sklearn.cluster`
3138
......................
3239

3340
- |Fix| Fixed a bug in :class:`cluster.BisectingKMeans`, preventing `fit` to randomly
3441
fail due to a permutation of the labels when running multiple inits.
3542
:pr:`25563` by :user:`Jérémie du Boisberranger <jeremiedbb>`.
3643

44+
:mod:`sklearn.compose`
45+
......................
46+
47+
- |Fix| Fixes a bug in :class:`compose.ColumnTransformer` which now supports
48+
empty selection of columns when `set_output(transform="pandas")`.
49+
:pr:`25570` by `Thomas Fan`_.
50+
51+
:mod:`sklearn.ensemble`
52+
.......................
53+
54+
- |Fix| A deprecation warning is raised when using the `base_estimator__` prefix
55+
to set parameters of the estimator used in :class:`ensemble.AdaBoostClassifier`,
56+
:class:`ensemble.AdaBoostRegressor`, :class:`ensemble.BaggingClassifier`,
57+
and :class:`ensemble.BaggingRegressor`.
58+
:pr:`25477` by :user:`Tim Head <betatim>`.
59+
3760
:mod:`sklearn.isotonic`
3861
.......................
3962

@@ -42,6 +65,13 @@ Changelog
4265
when the global configuration sets `transform_output="pandas"`.
4366
:pr:`25500` by :user:`Guillaume Lemaitre <glemaitre>`.
4467

68+
:mod:`sklearn.utils`
69+
....................
70+
71+
- |Fix| Fixes a bug in :func:`utils.check_array` which now correctly performs
72+
non-finite validation with the Array API specification. :pr:`25619` by
73+
`Thomas Fan`_.
74+
4575
.. _changes_1_2_1:
4676

4777
Version 1.2.1

doc/whats_new/v1.3.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ Changelog
157157
inconsistent with the sckit-learn verion the estimator was pickled with.
158158
:pr:`25297` by `Thomas Fan`_.
159159

160+
:mod:`sklearn.feature_selection`
161+
................................
162+
163+
- |Enhancement| All selectors in :mod:`sklearn.feature_selection` will preserve
164+
a DataFrame's dtype when transformed. :pr:`25102` by `Thomas Fan`_.
165+
160166
:mod:`sklearn.impute`
161167
.....................
162168

@@ -183,6 +189,15 @@ Changelog
183189
dissimilarity is not a metric and cannot be supported by the BallTree.
184190
:pr:`25417` by :user:`Guillaume Lemaitre <glemaitre>`.
185191

192+
:mod:`sklearn.neural_network`
193+
.............................
194+
195+
- |Fix| :class:`neural_network.MLPRegressor` and :class:`neural_network.MLPClassifier`
196+
reports the right `n_iter_` when `warm_start=True`. It corresponds to the number
197+
of iterations performed on the current call to `fit` instead of the total number
198+
of iterations performed since the initialization of the estimator.
199+
:pr:`25443` by :user:`Marvin Krawutschke <Marvvxi>`.
200+
186201
:mod:`sklearn.pipeline`
187202
.......................
188203

examples/cluster/plot_kmeans_digits.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def bench_k_means(kmeans, name, data, labels):
114114
#
115115
# We will compare three approaches:
116116
#
117-
# * an initialization using `kmeans++`. This method is stochastic and we will
117+
# * an initialization using `k-means++`. This method is stochastic and we will
118118
# run the initialization 4 times;
119119
# * a random initialization. This method is stochastic as well and we will run
120120
# the initialization 4 times;

examples/cluster/plot_kmeans_plusplus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
)
2424
X = X[:, ::-1]
2525

26-
# Calculate seeds from kmeans++
26+
# Calculate seeds from k-means++
2727
centers_init, indices = kmeans_plusplus(X, n_clusters=4, random_state=0)
2828

2929
# Plot init seeds along side sample data

examples/cluster/plot_kmeans_stability_low_dim_dense.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
1111
The first plot shows the best inertia reached for each combination
1212
of the model (``KMeans`` or ``MiniBatchKMeans``), and the init method
13-
(``init="random"`` or ``init="kmeans++"``) for increasing values of the
13+
(``init="random"`` or ``init="k-means++"``) for increasing values of the
1414
``n_init`` parameter that controls the number of initializations.
1515
1616
The second plot demonstrates one single run of the ``MiniBatchKMeans``

examples/linear_model/plot_logistic_l1_l2_sparsity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
# Set regularization parameter
4242
for i, (C, axes_row) in enumerate(zip((1, 0.1, 0.01), axes)):
43-
# turn down tolerance for short training time
43+
# Increase tolerance for short training time
4444
clf_l1_LR = LogisticRegression(C=C, penalty="l1", tol=0.01, solver="saga")
4545
clf_l2_LR = LogisticRegression(C=C, penalty="l2", tol=0.01, solver="saga")
4646
clf_en_LR = LogisticRegression(

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"sklearn.svm._libsvm",
111111
"sklearn.svm._libsvm_sparse",
112112
"sklearn.svm._newrand",
113+
"sklearn.tree._criterion",
113114
"sklearn.tree._splitter",
114115
"sklearn.tree._tree",
115116
"sklearn.tree._utils",
@@ -120,7 +121,6 @@
120121
"sklearn.utils._logistic_sigmoid",
121122
"sklearn.utils._openmp_helpers",
122123
"sklearn.utils._random",
123-
"sklearn.utils._readonly_array_wrapper",
124124
"sklearn.utils._seq_dataset",
125125
"sklearn.utils._sorting",
126126
"sklearn.utils._typedefs",
@@ -269,7 +269,7 @@ def check_package_status(package, min_version):
269269
{"sources": ["_isotonic.pyx"], "include_np": True},
270270
],
271271
"_loss": [
272-
{"sources": ["_loss.pyx.tp"], "include_np": True},
272+
{"sources": ["_loss.pyx.tp"]},
273273
],
274274
"cluster": [
275275
{"sources": ["_dbscan_inner.pyx"], "language": "c++", "include_np": True},
@@ -455,7 +455,6 @@ def check_package_status(package, min_version):
455455
},
456456
{"sources": ["_random.pyx"], "include_np": True},
457457
{"sources": ["_logistic_sigmoid.pyx"], "include_np": True},
458-
{"sources": ["_readonly_array_wrapper.pyx"], "include_np": True},
459458
{"sources": ["_typedefs.pyx"], "include_np": True},
460459
{"sources": ["_heap.pyx"], "include_np": True},
461460
{"sources": ["_sorting.pyx"], "include_np": True},

0 commit comments

Comments
 (0)
0