Skip to main content
Tweeted twitter.com/StackStats/status/787896792537042944

How numpy solvesdoes NumPy solve least squares with insufficient datafor underdetermined systems?

Source Link

How numpy solves least squares with insufficient data?

Let's say that we have X of shape (2, 5)
and y of shape (2,)

This works: np.linalg.lstsq(X, y)

We would expect this to work only if X was of shape (N,5) where N>=5 But why and how?

We do get back 5 weights as expected but how is this problem solved?

Isn't it like we have 2 equations and 5 unknowns?
How could numpy solve this?
It must do something like interpolation to create more artificial equations?..