MAINT Clean deprecation for 1.2: default random_state in randomized_svd
@@ -293,7 +293,7 @@ def randomized_svd(
power_iteration_normalizer="auto",
transpose="auto",
flip_sign=True,
- random_state="warn",
+ random_state=None,
svd_lapack_driver="gesdd",
):
"""Compute a truncated randomized SVD.
@@ -366,10 +366,7 @@ def randomized_svd(
function calls. See :term:`Glossary <random_state>`.
.. versionchanged:: 1.2
- The previous behavior (`random_state=0`) is deprecated, and
- from v1.2 the default value will be `random_state=None`. Set
- the value of `random_state` explicitly to suppress the deprecation
- warning.
+ The default value changed from 0 to None.
svd_lapack_driver : {"gesdd", "gesvd"}, default="gesdd"
Whether to use the more efficient divide-and-conquer approach
@@ -431,19 +428,6 @@ def randomized_svd(
sparse.SparseEfficiencyWarning,
)
- if random_state == "warn":
- warnings.warn(
- "If 'random_state' is not supplied, the current default "
- "is to use 0 as a fixed seed. This will change to "
- "None in version 1.2 leading to non-deterministic results "
- "that better reflect nature of the randomized_svd solver. "
- "If you want to silence this warning, set 'random_state' "
- "to an integer seed or to None explicitly depending "
- "if you want your code to be deterministic or not.",
- FutureWarning,
- )
- random_state = 0
-
random_state = check_random_state(random_state)
n_random = n_components + n_oversamples
n_samples, n_features = M.shape
