dask 2021.10.0

ParametersReturns
lstsq(a, b)

Solves the equation :None:None:`a x = b` by computing a vector x that minimizes the Euclidean 2-norm :None:None:`|| b - a x ||^2`. The equation may be under-, well-, or over- determined (i.e., the number of linearly independent rows of a can be less than, equal to, or greater than its number of linearly independent columns). If a is square and of full rank, then x (but for round-off error) is the "exact" solution of the equation.

Parameters

a : (M, N) array_like

"Coefficient" matrix.

b : {(M,), (M, K)} array_like

Ordinate or "dependent variable" values. If b is two-dimensional, the least-squares solution is calculated for each of the K columns of b.

Returns

x : {(N,), (N, K)} Array

Least-squares solution. If b is two-dimensional, the solutions are in the K columns of x.

residuals : {(1,), (K,)} Array

Sums of residuals; squared Euclidean 2-norm for each column in b - a*x . If b is 1-dimensional, this is a (1,) shape array. Otherwise the shape is (K,).

rank : Array

Rank of matrix a.

s : (min(M, N),) Array

Singular values of a.

Return the least-squares solution to a linear matrix equation using QR decomposition.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /dask/array/linalg.py#1362
type: <class 'function'>
Commit: