8000 MNT change 0.25 to 1.0 and 0.26 to 1.1 in deprecation messages (#19005) · scikit-learn/scikit-learn@2218ec4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2218ec4

Browse files
MNT change 0.25 to 1.0 and 0.26 to 1.1 in deprecation messages (#19005)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
1 parent 51bd343 commit 2218ec4

Some content is hidden

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

75 files changed

+393
-339
lines changed

doc/developers/develop.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ to slice rows and columns.
228228

229229
.. deprecated:: 0.24
230230

231-
The _pairwise attribute is deprecated in 0.24. From 0.26 onward,
232-
the `pairwise` estimator tag should be used instead.
231+
The _pairwise attribute is deprecated in 0.24. From 1.1 (renaming of 0.26)
232+
onward, the `pairwise` estimator tag should be used instead.
233233

234234
Universal attributes
235235
^^^^^^^^^^^^^^^^^^^^

doc/glossary.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,9 @@ General Concepts
389389

390390
.. deprecated:: 0.24
391391

392-
The _pairwise attribute is deprecated in 0.24. From 0.26
393-
onward, the `pairwise` estimator tag should be used
394-
instead.
392+
The _pairwise attribute is deprecated in 0.24. From 1.1
393+
(renaming of 0.26) onward, the `pairwise` estimator tag
394+
should be used instead.
395395

396396
For more detailed info, see :ref:`estimator_tags`.
397397

doc/modules/classes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,5 +1637,5 @@ Utilities from joblib:
16371637
Recently deprecated
16381638
===================
16391639

1640-
To be removed in 0.25
1641-
---------------------
1640+
To be removed in 1.0 (renaming of 0.25)
1641+
---------------------------------------

doc/whats_new/v0.23.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ In an effort to promote clear and non-ambiguous use of the library, most
166166
constructor and function parameters are now expected to be passed as keyword
167167
arguments (i.e. using the `param=value` syntax) instead of positional. To
168168
ease the transition, a `FutureWarning` is raised if a keyword-only parameter
169-
is used as positional. In version 0.25, these parameters will be strictly
170-
keyword-only, and a `TypeError` will be raised.
169+
is used as positional. In version 1.0 (renaming of 0.25), these parameters
170+
will be strictly keyword-only, and a `TypeError` will be raised.
171171
:issue:`15005` by `Joel Nothman`_, `Adrin Jalali`_, `Thomas Fan`_, and
172172
`Nicolas Hug`_. See `SLEP009
173173
<https://scikit-learn-enhancement-proposals.readthedocs.io/en/latest/slep009/proposal.html>`_

doc/whats_new/v0.24.rst

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ Changelog
104104
initial cluster centroids. :pr:`17937` by :user:`g-walsh`
105105

106106
- |API| :class:`cluster.MiniBatchKMeans` attributes, `counts_` and
107-
`init_size_`, are deprecated and will be removed in 0.26. :pr:`17864` by
108-
:user:`Jérémie du Boisberranger <jeremiedbb>`.
107+
`init_size_`, are deprecated and will be removed in 1.1 (renaming of 0.26).
108+
:pr:`17864` by :user:`Jérémie du Boisberranger <jeremiedbb>`.
109109

110110
:mod:`sklearn.compose`
111111
......................
@@ -128,7 +128,8 @@ Changelog
128128
- |API| Deprecates `cv_alphas_` in favor of `cv_results_['alphas']` and
129129
`grid_scores_` in favor of split scores in `cv_results_` in
130130
:class:`covariance.GraphicalLassoCV`. `cv_alphas_` and `grid_scores_` will be
131-
removed in version 0.26. :pr:`16392` by `Thomas Fan`_.
131+
removed in version 1.1 (renaming of 0.26).
132+
:pr:`16392` by `Thomas Fan`_.
132133

133134
:mod:`sklearn.cross_decomposition`
134135
..................................
@@ -149,7 +150,7 @@ Changelog
149150
- |API| For :class:`cross_decomposition.NMF`,
150151
the `init` value, when 'init=None' and
151152
n_components <= min(n_samples, n_features) will be changed from
152-
`'nndsvd'` to `'nndsvda'` in 0.26.
153+
`'nndsvd'` to `'nndsvda'` in 1.1 (renaming of 0.26).
153154
:pr:`18525` by :user:`Chiara Marmo <cmarmo>`.
154155

155156
- |API| The bounds of the `n_components` parameter is now restricted:
@@ -159,20 +160,23 @@ Changelog
159160
and :class:`cross_decomposition.PLSCanonical`.
160161
- into `[1, n_features]` or :class:`cross_decomposition.PLSRegression`.
161162

162-
An error will be raised in 0.26. :pr:`17095` by `Nicolas Hug`_.
163+
An error will be raised in 1.1 (renaming of 0.26).
164+
:pr:`17095` by `Nicolas Hug`_.
163165

164166
- |API| For :class:`cross_decomposition.PLSSVD`,
165167
:class:`cross_decomposition.CCA`, and
166168
:class:`cross_decomposition.PLSCanonical`, the `x_scores_` and `y_scores_`
167-
attributes were deprecated and will be removed in 0.26. They can be
168-
retrieved by calling `transform` on the training data. The `norm_y_weights`
169-
attribute will also be removed. :pr:`17095` by `Nicolas Hug`_.
169+
attributes were deprecated and will be removed in 1.1 (renaming of 0.26).
170+
They can be retrieved by calling `transform` on the training data.
171+
The `norm_y_weights` attribute will also be removed.
172+
:pr:`17095` by `Nicolas Hug`_.
170173

171174
- |API| For :class:`cross_decomposition.PLSRegression`,
172175
:class:`cross_decomposition.PLSCanonical`,
173176
:class:`cross_decomposition.CCA`, and
174177
:class:`cross_decomposition.PLSSVD`, the `x_mean_`, `y_mean_`, `x_std_`, and
175-
`y_std_` attributes were deprecated and will be removed in 0.26.
178+
`y_std_` attributes were deprecated and will be removed in 1.1
179+
(renaming of 0.26).
176180
:pr:`18768` by :user:`Maren Westermann <marenwestermann>`.
177181

178182
- |Fix| :class:`decomposition.TruncatedSVD` becomes deterministic by using the
@@ -240,8 +244,9 @@ Changelog
240244

241245
- |Fix| Fix :class:`decomposition.SparseCoder` such that it follows
242246
scikit-learn API and support cloning. The attribute `components_` is
243-
deprecated in 0.24 and will be removed in 0.26. This attribute was
244-
redundant with the `dictionary` attribute and constructor parameter.
247+
deprecated in 0.24 and will be removed in 1.1 (renaming of 0.26).
248+
This attribute was redundant with the `dictionary` attribute and constructor
249+
parameter.
245250
:pr:`17679` by :user:`Xavier Dupré <sdpython>`.
246251

247252
- |Fix| :meth:`TruncatedSVD.fit_transform` consistently returns the same
@@ -302,7 +307,8 @@ Changelog
302307

303308
- |API| :class:`exceptions.ChangedBehaviorWarning` and
304309
:class:`exceptions.NonBLASDotWarning` are deprecated and will be removed in
305-
v0.26, :pr:`17804` by `Adrin Jalali`_.
310+
1.1 (renaming of 0.26).
311+
:pr:`17804` by `Adrin Jalali`_.
306312

307313
:mod:`sklearn.feature_extraction`
308314
.................................
@@ -390,7 +396,8 @@ Changelog
390396
:user:`Roei Kahny <RoeiKa>`.
391397

392398
- |API| Positional arguments are deprecated in
393-
:meth:`inspection.PartialDependenceDisplay.plot` and will error in 0.26.
399+
:meth:`inspection.PartialDependenceDisplay.plot` and will error in 1.1
400+
(renaming of 0.26).
394401
:pr:`18293` by `Thomas Fan`_.
395402

396403
:mod:`sklearn.isotonic`
@@ -458,8 +465,8 @@ Changelog
458465

459466
- |Enhancement| Add `square_distances` parameter to :class:`manifold.TSNE`,
460467
which provides backward compatibility during deprecation of legacy squaring
461-
behavior. Distances will be squared by default in 0.26, and this parameter
462-
will be removed in 0.28. :pr:`17662` by
468+
behavior. Distances will be squared by default in 1.1 (renaming of 0.26),
469+
and this parameter will be removed in 1.3. :pr:`17662` by
463470
:user:`Joshua Newton <joshuacwnewton>`.
464471

465472
- |Fix| :class:`manifold.MDS` now correctly sets its `_pairwise` attribute.
@@ -645,8 +652,8 @@ Changelog
645652
- |API| The attributes ``coef_`` and ``intercept_`` are now deprecated in
646653
:class:`naive_bayes.MultinomialNB`, :class:`naive_bayes.ComplementNB`,
647654
:class:`naive_bayes.BernoulliNB` and :class:`naive_bayes.CategoricalNB`,
648-
and will be removed in v0.26. :pr:`17427` by
649-
:user:`Juan Carlos Alfaro Jiménez <alfaro96>`.
655+
and will be removed in v1.1 (renaming of 0.26).
656+
:pr:`17427` by :user:`Juan Carlos Alfaro Jiménez <alfaro96>`.
650657

651658
:mod:`sklearn.neighbors`
652659
........................

sklearn/base.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -845,9 +845,12 @@ def _is_pairwise(estimator):
845845

846846
if has_pairwise_attribute:
847847
if pairwise_attribute != pairwise_tag:
848-
warnings.warn("_pairwise was deprecated in 0.24 and will be "
849-
"removed in 0.26. Set the estimator tags of your "
850-
"estimator instead", FutureWarning)
848+
warnings.warn(
849+
"_pairwise was deprecated in 0.24 and will be removed in 1.1 "
850+
"(renaming of 0.26). Set the estimator tags of your estimator "
851+
"instead",
852+
FutureWarning
853+
)
851854
return pairwise_attribute
852855

853856
# use pairwise tag when the attribute is not present

sklearn/calibration.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ class _CalibratedClassifier:
599599
600600
.. deprecated:: 0.24
601601
`calibrators_` is deprecated from 0.24 and will be removed in
602-
0.26. Use `calibrators` instead.
602+
1.1 (renaming of 0.26). Use `calibrators` instead.
603603
"""
604604
def __init__(self, base_estimator, calibrators, *, classes,
605605
method='sigmoid'):
@@ -608,11 +608,11 @@ def __init__(self, base_estimator, calibrators, *, classes,
608608
self.classes = classes
609609
self.method = method
610610

611-
# TODO: Remove in 0.26
611+
# TODO: Remove in 1.1
612612
# mypy error: Decorated property not supported
613613
@deprecated( # type: ignore
614-
"calibrators_ is deprecated in 0.24 and will be removed in 0.26. "
615-
"Use calibrators instead."
614+
"calibrators_ is deprecated in 0.24 and will be removed in 1.1"
615+
"(renaming of 0.26). Use calibrators instead."
616616
)
617617
@property
618618
def calibrators_(self):

sklearn/cluster/_affinity_propagation.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,14 @@ def affinity_propagation(S, *, preference=None, convergence_iter=15,
145145
else (np.array([0]), np.array([0] * n_samples)))
146146

147147
if random_state == 'warn':
148-
warnings.warn(("'random_state' has been introduced in 0.23. "
149-
"It will be set to None starting from 0.25 which "
150-
"means that results will differ at every function "
151-
"call. Set 'random_state' to None to silence this "
152-
"warning, or to 0 to keep the behavior of versions "
153-
"<0.23."),
154-
FutureWarning)
148+
warnings.warn(
149+
"'random_state' has been introduced in 0.23. It will be set to "
150+
"None starting from 1.0 (renaming of 0.25) which means that "
151+
"results will differ at every function call. Set 'random_state' "
152+
"to None to silence this warning, or to 0 to keep the behavior of "
153+
"versions <0.23.",
154+
FutureWarning
155+
)
155156
10000 random_state = 0
156157
random_state = check_random_state(random_state)
157158

@@ -375,10 +376,10 @@ def __init__(self, *, damping=.5, max_iter=200, convergence_iter=15,
375376
self.affinity = affinity
376377
self.random_state = random_state
377378

378-
# TODO: Remove in 0.26
379+
# TODO: Remove in 1.1
379380
# mypy error: Decorated property not supported
380381
@deprecated("Attribute _pairwise was deprecated in " # type: ignore
381-
"version 0.24 and will be removed in 0.26.")
382+
"version 0.24 and will be removed in 1.1 (renaming of 0.26).")
382383
@property
383384
def _pairwise(self):
384385
return self.affinity == "precomputed"

sklearn/cluster/_bicluster.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def fit(self, X, y=None):
118118
"""
119119
if self.n_jobs != 'deprecated':
120120
warnings.warn("'n_jobs' was deprecated in version 0.23 and will be"
121-
" removed in 0.25.", FutureWarning)
121+
" removed in 1.0 (renaming of 0.25).", FutureWarning)
122122

123123
X = self._validate_data(X, accept_sparse='csr', dtype=np.float64)
124124
self._check_parameters()
@@ -240,7 +240,7 @@ class SpectralCoclustering(BaseSpectral):
240240
241241
.. deprecated:: 0.23
242242
``n_jobs`` was deprecated in version 0.23 and will be removed in
243-
0.25.
243+
1.0 (renaming of 0.25).
244244
245245
random_state : int, RandomState instance, default=None
246246
Used for randomizing the singular value decomposition and the k-means
@@ -392,7 +392,7 @@ class SpectralBiclustering(BaseSpectral):
392392
393393
.. deprecated:: 0.23
394394
``n_jobs`` was deprecated in version 0.23 and will be removed in
395-
0.25.
395+
1.0 (renaming of 0.25).
396396
397397
random_state : int, RandomState instance, default=None
398398
Used for randomizing the singular value decomposition and the k-means

sklearn/cluster/_kmeans.py

Lines changed: 14 additions & 12 deletions
< 10000 td data-grid-cell-id="diff-76c1b698a39908553a336a1284b06031ca2bfaea2db2293149b825edc61d4284-1585-1587-0" data-selected="false" role="gridcell" style="background-color:var(--bgColor-default);text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative diff-line-number-neutral left-side">1585
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def k_means(X, n_clusters, *, sample_weight=None, init='k-means++',
212212
213213
.. deprecated:: 0.23
214214
'precompute_distances' was deprecated in version 0.23 and will be
215-
removed in 0.25. It has no effect.
215+
removed in 1.0 (renaming of 0.25). It has no effect.
216216
217217
n_init : int, default=10
218218
Number of time the k-means algorithm will be run with different
@@ -254,7 +254,7 @@ def k_means(X, n_clusters, *, sample_weight=None, init='k-means++',
254254
255255
.. deprecated:: 0.23
256256
``n_jobs`` was deprecated in version 0.23 and will be removed in
257-
0.25.
257+
1.0 (renaming of 0.25).
258258
259259
algorithm : {"auto", "full", "elkan"}, default="auto"
260260
K-means algorithm to use. The classical EM-style algorithm is "full".
@@ -657,7 +657,7 @@ class KMeans(TransformerMixin, ClusterMixin, BaseEstimator):
657657
658658
.. deprecated:: 0.23
659659
'precompute_distances' was deprecated in version 0.22 and will be
660-
removed in 0.25. It has no effect.
660+
removed in 1.0 (renaming of 0.25). It has no effect.
661661
662662
verbose : int, default=0
663663
Verbosity mode.
@@ -686,7 +686,7 @@ class KMeans(TransformerMixin, ClusterMixin, BaseEstimator):
686686
687687
.. deprecated:: 0.23
688688
``n_jobs`` was deprecated in version 0.23 and will be removed in
689-
0.25.
689+
1.0 (renaming of 0.25).
690690
691691
algorithm : {"auto", "full", "elkan"}, default="auto"
692692
K-means algorithm to use. The classical EM-style algorithm is "full".
@@ -784,13 +784,13 @@ def _check_params(self, X):
784784
# precompute_distances
785785
if self.precompute_distances != 'deprecated':
786786
warnings.warn("'precompute_distances' was deprecated in version "
787-
"0.23 and will be removed in 0.25. It has no "
788-
"effect", FutureWarning)
787+
"0.23 and will be removed in 1.0 (renaming of 0.25)"
788+
". It has no effect", FutureWarning)
789789

790790
# n_jobs
791791
if self.n_jobs != 'deprecated':
792792
warnings.warn("'n_jobs' was deprecated in version 0.23 and will be"
793-
" removed in 0.25.", FutureWarning)
793+
" removed in 1.0 (renaming of 0.25).", FutureWarning)
794794
self._n_threads = self.n_jobs
795795
else:
796796
self._n_threads = None
@@ -1512,13 +1512,15 @@ class MiniBatchKMeans(KMeans):
15121512
Weigth sum of each cluster.
15131513
15141514
.. deprecated:: 0.24
1515-
This attribute is deprecated in 0.24 and will be removed in 0.26.
1515+
This attribute is deprecated in 0.24 and will be removed in
1516+
1.1 (renaming of 0.26).
15161517
15171518
init_size_ : int
15181519
The effective number of samples used for the initialization.
15191520
15201521
.. deprecated:: 0.24
1521-
This attribute is deprecated in 0.24 and will be removed in 0.26.
1522+
This attribute is deprecated in 0.24 and will be removed in
1523+
1.1 (renaming of 0.26).
15221524
15231525
See Also
15241526
--------
@@ -1577,19 +1579,19 @@ def __init__(self, n_clusters=8, *, init='k-means++', max_iter=100,
15771579
self.reassignment_ratio = reassignment_ratio
15781580

15791581
@deprecated("The attribute 'counts_' is deprecated in 0.24" # type: ignore
1580-
" and will be removed in 0.26.")
1582+
" and will be removed in 1.1 (renaming of 0.26).")
15811583
@property
15821584
def counts_(self):
15831585
return self._counts
15841586

1587
@deprecated("The attribute 'init_size_' is deprecated in " # type: ignore
1586-
"0.24 and will be removed in 0.26.")
1588+
"0.24 and will be removed in 1.1 (renaming of 0.26).")
15871589
@property
15881590
def init_size_(self):
15891591
return self._init_size
15901592

15911593
@deprecated("The attribute 'random_state_' is deprecated " # type: ignore
1592-
"in 0.24 and will be removed in 0.26.")
1594+
"in 0.24 and will be removed in 1.1 (renaming of 0.26).")
15931595
@property
15941596
def random_state_(self):
15951597
return getattr(self, "_random_state", None)

sklearn/cluster/_spectral.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,10 +571,10 @@ def _more_tags(self):
571571
return {'pairwise': self.affinity in ["precomputed",
572572
"precomputed_nearest_neighbors"]}
573573

574-
# TODO: Remove in 0.26
574+
# TODO: Remove in 1.1
575575
# mypy error: Decorated property not supported
576576
@deprecated("Attribute _pairwise was deprecated in " # type: ignore
577-
"version 0.24 and will be removed in 0.26.")
577+
"version 0.24 and will be removed in 1.1 (renaming of 0.26).")
578578
@property
579579
def _pairwise(self):
580580
return self.affinity in ["precomputed",

sklearn/cluster/tests/test_affinity_propagation.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,11 @@ def test_affinity_propagation_random_state():
204204
assert np.mean((centers0 - centers76) ** 2) > 1
205205

206206

207-
# FIXME: to be removed in 0.25
207+
# FIXME: to be removed in 1.0
208208
def test_affinity_propagation_random_state_warning():
209209
# test that a warning is raised when random_state is not defined.
210210
X = np.array([[0, 0], [1, 1], [-2, -2]])
211-
match = ("'random_state' has been introduced in 0.23. "
212-
"It will be set to None starting from 0.25 which "
213-
"means that results will differ at every function "
214-
"call. Set 'random_state' to None to silence this "
215-
"warning, or to 89E0 0 to keep the behavior of versions "
216-
"<0.23.")
211+
match = "'random_state' has been introduced in 0.23."
217212
with pytest.warns(FutureWarning, match=match):
218213
AffinityPropagation().fit(X)
219214

@@ -246,7 +241,7 @@ def test_affinity_propagation_float32():
246241
assert_array_equal(afp.labels_, expected)
247242

248243

249-
# TODO: Remove in 0.26
244+
# TODO: Remove in 1.1
250245
def test_affinity_propagation_pairwise_is_deprecated():
251246
afp = AffinityPropagation(affinity='precomputed')
252247
msg = r"Attribute _pairwise was deprecated in version 0\.24"

0 commit comments

Comments
 (0)
0