gneiss ols-regression error "SVD did not converge"


Can someone enlighten me on the meaning of this error, and what I might do to resolve it?


CLI command (qiime2-2019.7):
qiime gneiss ols-regression --verbose --i-table input/M_balances.qza --i-tree input/M_hierarchy.qza --m-metadata-file input/GCMP_EMP_map_r28.txt --p-formula “temperature+host_scientific_name” --o-visualization output/M_regression_summary.qzv

Red text:
Plugin error from gneiss:
SVD did not converge

Verbose output:
Traceback (most recent call last):
File “/home/dylan/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/q2cli/”, line 327, in call
results = action(**arguments)
File “</home/dylan/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/>”, line 2, in ols_regression
File “/home/dylan/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/sdk/”, line 240, in bound_callable
output_types, provenance)
File “/home/dylan/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/sdk/”, line 445, in callable_executor
ret_val = self._callable(output_dir=temp_dir, **view_args)
File “/home/dylan/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/q2_gneiss/regression/”, line 34, in ols_regression
ols_summary(output_dir, res, tree)
File “/home/dylan/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/gneiss/plot/”, line 288, in ols_summary
_k, _l = model.kfold(), model.lovo()
File “/home/dylan/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/gneiss/regression/”, line 472, in lovo**kwargs)
File “/home/dylan/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/gneiss/regression/”, line 174, in fit
inv = np.linalg.pinv(, X))
File “<array_function internals>”, line 6, in pinv
File “/home/dylan/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/numpy/linalg/”, line 1970, in pinv
u, s, vt = svd(a, full_matrices=False, hermitian=hermitian)
File “<array_function internals>”, line 6, in svd
File “/home/dylan/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/numpy/linalg/”, line 1636, in svd
u, s, vh = gufunc(a, signature=signature, extobj=extobj)
File “/home/dylan/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/numpy/linalg/”, line 106, in _raise_linalgerror_svd_nonconvergence
raise LinAlgError(“SVD did not converge”)
numpy.linalg.LinAlgError: SVD did not converge


Hi @dylan, when this error shows up, it implies that there is something weird going on with the metadata.

How many samples are there? How many hosts are there? Are there any categorical values that snuck into your temperature column? Are there missing entries in your metadata?

There is also a relevant post here that may help with debugging: Gneiss Singular matrix error


Thanks for your help!

Temperature was not in fact all numeric, so I removed the offenders and it fixed the issue.