Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numpy.linalg.linalg.LinAlgError: Singular matrix #5

Open
nabidam opened this issue Apr 10, 2019 · 0 comments
Open

numpy.linalg.linalg.LinAlgError: Singular matrix #5

nabidam opened this issue Apr 10, 2019 · 0 comments

Comments

@nabidam
Copy link

nabidam commented Apr 10, 2019

hello, I'm using NMF_ANLS_BLOCKPIVOT algorithm on a 200x990 matrix with this code
W1, H1, info1 = NMF_ANLS_BLOCKPIVOT().run(X1, 56, max_iter=500, verbose=1)
but after running for about 15 minutes, it shows an error for singular matrix:

File "nnmf.py", line 120, in
W1, H1, info1 = nmf().run(X1, rank, max_iter=500, verbose=1)
File "/home/navid/anaconda3/envs/fr/lib/python3.6/site-packages/nonnegfac/nmf.py", line 97, in run
(W, H) = self.iter_solver(A, W, H, k, i)
File "/home/navid/anaconda3/envs/fr/lib/python3.6/site-packages/nonnegfac/nmf.py", line 195, in iter_solver
Sol, info = nnlsm_blockpivot(W, A, init=H.T)
File "/home/navid/anaconda3/envs/fr/lib/python3.6/site-packages/nonnegfac/nnls.py", line 120, in nnlsm_blockpivot
AtA, AtB[:, not_opt_cols], PassSet[:, not_opt_cols])
File "/home/navid/anaconda3/envs/fr/lib/python3.6/site-packages/nonnegfac/nnls.py", line 322, in normal_eq_comb
Z[ix1] = nla.solve(AtA[ix2], AtB[ix1])
File "/home/navid/anaconda3/envs/fr/lib/python3.6/site-packages/numpy/linalg/linalg.py", line 394, in solve
r = gufunc(a, b, signature=signature, extobj=extobj)
File "/home/navid/anaconda3/envs/fr/lib/python3.6/site-packages/numpy/linalg/linalg.py", line 89, in _raise_linalgerror_singular
raise LinAlgError("Singular matrix")
numpy.linalg.linalg.LinAlgError: Singular matrix

I searched the singular matrix error and I got this error happens if a numpy matrix isn't invertible.
now what should I do?
sorry for my bad english and I thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant