dask.array.linalg.svd_compressed(a, k, iterator='power', n_power_iter=0, n_oversamples=10, seed=None, compute=False, coerce_signs=True)[source]

Randomly compressed rank-k thin Singular Value Decomposition.

This computes the approximate singular value decomposition of a large array. This algorithm is generally faster than the normal algorithm but does not provide exact results. One can balance between performance and accuracy with input parameters (see below).

a: Array

Input array

k: int

Rank of the desired thin SVD decomposition.

iterator: {‘power’, ‘QR’}, default=’power’

Define the technique used for iterations to cope with flat singular spectra or when the input matrix is very large.

n_power_iter: int, default=0

Number of power iterations, useful when the singular values decay slowly. Error decreases exponentially as n_power_iter increases. In practice, set n_power_iter <= 4.

n_oversamples: int, default=10

Number of oversamples used for generating the sampling matrix. This value increases the size of the subspace computed, which is more accurate at the cost of efficiency. Results are rarely sensitive to this choice though and in practice a value of 10 is very commonly high enough.


Whether or not to compute data at each use. Recomputing the input while performing several passes reduces memory pressure, but means that we have to compute the input multiple times. This is a good choice if the data is larger than memory and cheap to recreate.


Whether or not to apply sign coercion to singular vectors in order to maintain deterministic results, by default True.

u: Array, unitary / orthogonal
s: Array, singular values in decreasing order (largest first)
v: Array, unitary / orthogonal


N. Halko, P. G. Martinsson, and J. A. Tropp. Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions. SIAM Rev., Survey and Review section, Vol. 53, num. 2, pp. 217-288, June 2011 https://arxiv.org/abs/0909.4061


>>> u, s, v = svd_compressed(x, 20)