Git Product home page Git Product logo

Comments (3)

woodsp-ibm avatar woodsp-ibm commented on July 17, 2024

Hi, Aqua code is now deprecated and only critical fixes are being considered. The QSVM algorithm has been superseded by the QSVC algorithm in machine learning here https://github.com/Qiskit/qiskit-machine-learning/blob/main/qiskit_machine_learning/algorithms/classifiers/qsvc.py It likewise uses a QuantumKernel but is a more direct integration with sklearn in that the quantum kernel is passed to the sklearn SVC; looks like that might be useful to you. You might also like to look at this tutorial https://qiskit.org/documentation/machine-learning/tutorials/03_quantum_kernel.html. The integration with sklearn has other advantages such as access to other tools etc of sklearn that work with the SVC etc.

from qiskit-aqua.

zoplex avatar zoplex commented on July 17, 2024

Thank you, in the meantime it was confirmed that the call:

kernel_matrix_testing = result['kernel_matrix_testing']

returns [test x n_support_vectors], not [test x train], and in debugger it could be seen too, so our assumption of being able to extract both train and test kernel matrices from prior version of QSVM would not work.

In the new version it seems that if one wants both train and test kernel matrices, then those need to be calculated individually and cannot be extracted from the QSVC:

adhoc_matrix_train = adhoc_kernel.evaluate(x_vec=train_features)
adhoc_matrix_test = adhoc_kernel.evaluate(x_vec=test_features,
y_vec=train_features)

from qiskit-aqua.

woodsp-ibm avatar woodsp-ibm commented on July 17, 2024

For the QSVM you can see the code and what it produces when it runs here - https://github.com/Qiskit/qiskit-aqua/blob/main/qiskit/aqua/algorithms/classifiers/qsvm/_qsvm_binary.py#L133

The QSVC is just really just a very simple sub-class of sklearn SVC with the QuantumKernel. Using the QSVC is the same therefore as using the sklearn SVC. And as that tutorial I linked above shows you can use the QuantumKernel directly with sklearn SVC and you do not even need to use the QSVC if you don't want to.

from qiskit-aqua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.