Open fishgoesbloop opened 4 years ago
To me, this seems related to similar issues me and other users (see, for instance https://github.com/Qiskit/qiskit-aqua/issues/1402) are having with QSVM. To me, it seems to be related to non-separability in the data. In this case, with the SklearnSVM, some warnings start appearing when the training size is set to 16, which is exactly the moment in which a point is added that makes the data not linearly-separable (it is apparent by inspection from the data plot).
Maybe the solver used to obtain the SVM model is somehow expecting the data to be separable? Is there a flag to activate a "soft margin" mode or something?
I ran the same training samples on the sklearn version of svm and managed to successfully train and test the model though.
Hmm, I had thought qiskit's SklearnSVM was based on it. Maybe there are slight differences?
Try using the latest version of the qp_solver.py, from qiskit aqua master branch and see if it converges. As stated in #1378, a L2 regularization term was added to the SVM optimizer. Maybe the sklearn svm is soft margin by default (i.e. has L2 regularization) and the qiskit SklearnSVM until the aforementioned recent change was not. Let us know if this change fixes your issue. It fixed mine #1402
Information
What is the current behavior?
Steps to reproduce the problem
What is the expected behavior?
No error
Suggested solutions
It seems like increasing the 'training_size' to above 20 will create this error.