diff --git a/doc/developers/utilities.rst b/doc/developers/utilities.rst index 05325badd1d65bb9866f55e8cd70127412dc4f29..466e82164702e5c9bf5e0b6dd3e2f005749e32e6 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 b6cf041424f20e443f1fb9434beaf32390495589..b944791b0378e6d9f305538c07ddc43ab7884fce 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)