Skip to content
Snippets Groups Projects
Commit 39618993 authored by Joseph Weston's avatar Joseph Weston
Browse files

use 'scipy.linalg.lstsq' instead of 'numpy.linalg.lstsq'

Numpy's leastsquares implementation sometimes produces memory errors,
but Scipy's appears to be unaffected (at least for the cases seen
thus far).
parent fcb2f5b8
Branches
Tags
No related merge requests found
......@@ -79,7 +79,7 @@ def lstsq(a, b):
"""Least squares version that works also with 0-shaped matrices."""
if a.shape[1] == 0:
return np.empty((0, 0), dtype=np.common_type(a, b))
return np.linalg.lstsq(a, b)[0]
return la.lstsq(a, b)[0]
def nonzero_symm_projection(matrix):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment