QSVC¶
- class QSVC(*args, quantum_kernel=None, **kwargs)[source]¶
Bases:
SVC
,SerializableModelMixin
Quantum Support Vector Classifier that extends the scikit-learn sklearn.svm.SVC classifier and introduces an additional quantum_kernel parameter.
This class shows how to use a quantum kernel for classification. The class inherits its methods like
fit
andpredict
from scikit-learn, see the example below. Read more in the scikit-learn user guide.Example
qsvc = QSVC(quantum_kernel=qkernel) qsvc.fit(sample_train,label_train) qsvc.predict(sample_test)
- Tham số:
quantum_kernel (
Optional
[BaseKernel
]) -- Quantum kernel to be used for classification.*args -- Variable length argument list to pass to SVC constructor.
**kwargs -- Arbitrary keyword arguments to pass to SVC constructor.
Attributes
Returns quantum kernel
Methods