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

Problem: Rank(A) < p or Rank([P; A; G]) < n #15

Open
gnawJ opened this issue Jul 6, 2018 · 4 comments
Open

Problem: Rank(A) < p or Rank([P; A; G]) < n #15

gnawJ opened this issue Jul 6, 2018 · 4 comments

Comments

@gnawJ
Copy link

gnawJ commented Jul 6, 2018

Here is the problem I got:

Traceback (most recent call last):
File "/Applications/PyCharm Edu.app/Contents/helpers/pydev/pydevd.py", line 1599, in
globals = debugger.run(setup['file'], None, None, is_module)
File "/Applications/PyCharm Edu.app/Contents/helpers/pydev/pydevd.py", line 1026, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Users/chilab/PycharmProjects/MILSVM/mis_stress.py", line 87, in
classifier.fit(X_train, y_train)
File "/Users/chilab/src/misvm/misvm/sil.py", line 45, in fit
super(SIL, self).fit(svm_X, svm_y)
File "/Users/chilab/src/misvm/misvm/svm.py", line 68, in fit
self.verbose)
File "/Users/chilab/src/misvm/misvm/quadprog.py", line 106, in quadprog
return qp.solve(verbose)
File "/Users/chilab/src/misvm/misvm/quadprog.py", line 77, in solve
raise e
ValueError: Rank(A) < p or Rank([P; A; G]) < n

Thx!

@garydoranjr
Copy link
Owner

I've seen this error before if there are duplicate instances in the dataset. This can cause the matrix in the optimization program to be rank-deficient.

@gnawJ
Copy link
Author

gnawJ commented Jul 10, 2018

Thanks for the reply!
Is it possible to turn off the optimization? Thx.

Also, I checked my dataset, it seems like there are no duplicated instances.

@garydoranjr
Copy link
Owner

No, the optimization cannot be turned off; it is fundamental to SVM classification: https://en.wikipedia.org/wiki/Support_vector_machine#Kernel_trick

It looks like the SVM code is being called by mis_stress.py (not in this repository). It is possible that however the data is manipulated by that code prior to calling the SIL fit method is leading to this issue.

@eugeneyuchunlin
Copy link

I have encountered the same issue in my implementation of SVM. I solve the problem by standardizing the data.

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

3 participants