I have a matrix A with shape (224, 45). It's rank is 44. When I try this code:
solution = np.linalg.lstsq(A, rhs)[0]
I get solution with very high values, something like 1e14.
When I try
solution = np.linalg.lstsq(A.T.dot(A), A.T.dot(rhs))[0]
I get good solution, as expected.
The question is do I need to use np.linalg.lstsq
only for square symmetric matrices or something like this? There is nothing about it in docs.