From cf1c1f17b6c01f63810e6101e5a09c6133d47030 Mon Sep 17 00:00:00 2001 From: Jake Vanderplas <vanderplas@astro.washington.edu> Date: Tue, 20 Dec 2011 02:13:58 -0800 Subject: [PATCH] randomized_range_finder -> randomized_power_iteration --- doc/developers/utilities.rst | 2 +- sklearn/utils/extmath.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/developers/utilities.rst b/doc/developers/utilities.rst index c85e73366e..5bb4a6a8f5 100644 --- a/doc/developers/utilities.rst +++ b/doc/developers/utilities.rst @@ -72,7 +72,7 @@ For example: Efficient Linear Algebra & Array Operations =========================================== -- :func:`extmath.randomized_range_finder`: construct an orthonormal matrix +- :func:`extmath.randomized_power_iteration`: construct an orthonormal matrix whose range approximates the range of the input. This is used in :func:`extmath.fast_svd`, below. diff --git a/sklearn/utils/extmath.py b/sklearn/utils/extmath.py index 4a994542ce..1ab8c528c6 100644 --- a/sklearn/utils/extmath.py +++ b/sklearn/utils/extmath.py @@ -79,7 +79,7 @@ def safe_sparse_dot(a, b, dense_output=False): return np.dot(a, b) -def randomized_range_finder(A, size, n_iterations, random_state=None): +def randomized_power_iteration(A, size, n_iterations, random_state=None): """Computes an orthonormal matrix whose range approximates the range of A. Parameters @@ -187,7 +187,7 @@ def fast_svd(M, k, p=None, n_iterations=0, transpose='auto', random_state=0): # this implementation is a bit faster with smaller shape[1] M = M.T - Q = randomized_range_finder(M, k+p, n_iterations, random_state) + Q = randomized_power_iteration(M, k+p, n_iterations, random_state) # project M to the (k + p) dimensional space using the basis vectors B = safe_sparse_dot(Q.T, M) -- GitLab