Open gnawJ opened 6 years ago
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.
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.
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.
I have encountered the same issue in my implementation of SVM. I solve the problem by standardizing the data.
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!