-
Notifications
You must be signed in to change notification settings - Fork 376
QSVM error with state vector simulator and breast cancer dataset #1402
Comments
I am having similar issues. It might be linked with a problem of non-separability in the data, since this also happens with the classical SVM as reported by another user here: #1401 Is it possible that the classical solver used to obtain the support vectors and alphas is in "hard margin" mode or something? |
Thank you for the prompt answer. It seems that adding lambda2 hyperparameter to make the SVM a soft margin one, has fixed my issue of convergence. It would be really nice as you mention in #1378 if this parameter could be tweaked from the QSVM class :) |
Adjusting the value, when you use QSVM, is already there - see lambda2 param https://github.com/Qiskit/qiskit-aqua/blob/36ffb11a08669f04ff6f7d44741c76eec8afeb2c/qiskit/aqua/algorithms/classifiers/qsvm/qsvm.py#L78-L95 As this seems to have fixed your issue - and also you have the means to adjust it, which is already there in line with your suggestion, I will go ahead and close this issue. |
Information
What is the current behavior?
qsvm.run(quantum_instance, verbose=True) gives an error when used for the breast cancer dataset.
The error comes from the cvxpy optimizer used in the qsvm. This issue is similar to the one previously raised (see below) with the qasm simulator due to sampling errors making the kernel matrix non positive semi-definite (fixed here: #1190). Nevertheless, this is not expected to happen with the statevector simulator where no errors are introduced.
Similar reports (with Qasm simulator):
Qiskit/qiskit-tutorials#1035
#1106
Steps to reproduce the problem
Running the following code:
The text was updated successfully, but these errors were encountered: