Back to Numerical Arrays (NumPy)
np.lstsq
Return the least-squares solution to a linear matrix equation.
Syntax
np.lstsq(a, b, rcond?)
Description
Return the least-squares solution to a linear matrix equation. Computes the vector x that approximately solves the equation a @ x = b.
Parameters
| Name | Description |
|---|---|
| a | - Coefficient matrix (M x N) |
| b | - Ordinate values (M,) or (M x K) |
| rcond(optional) | - Cutoff for small singular values |
Returns
Promise<LstsqResult>