diff --git a/doc/developers/utilities.rst b/doc/developers/utilities.rst index c85e73366e291bc61850241147fb2606722c971e..5bb4a6a8f51edcf572eef87ffc45c2fe6e84a7bb 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 4a994542ce46ef95ce1a363e734bb3e7da8bf67d..1ab8c528c6b5f2f063cfcfed4eab22ae3e7b6bdd 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)