Why do all tutorials that use QSVM from qiskit Aqua library have the number of features equal to 2?


1 Answer 1


Here is a tutorial that uses three classes! If you want to use more than two classes, you need a multiclass_extension which is provided as a parameter to the QSVM

svm = QSVM(feature_map, training_input, test_input, total_array,
          multiclass_extension=AllPairs(_QSVM_Estimator, [feature_map]))

As shown in the tutorial. There are a few multiclass extensions to choose from, which are all here.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.