From ea5d8e8f77d1dfec37ce404881e11d54c959e7ec Mon Sep 17 00:00:00 2001 From: Jake Vanderplas <vanderplas@astro.washington.edu> Date: Wed, 21 Dec 2011 00:31:56 -0800 Subject: [PATCH] randomized_power_iteration -> randomized_range_finder --- 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 05325badd1..466e821647 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_power_iteration`: construct an orthonormal matrix +- :func:`extmath.randomized_range_finder`: 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 b6cf041424..b944791b03 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_power_iteration(A, size, n_iterations, random_state=None): +def randomized_range_finder(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_power_iteration(M, k+p, n_iterations, random_state) + Q = randomized_range_finder(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