QSVC¶
- class QSVC(*, quantum_kernel=None, **kwargs)[소스]¶
기반 클래스:
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)
- 매개변수:
quantum_kernel (BaseKernel | None) – 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
Weights assigned to the features when kernel="linear".
Number of support vectors for each class.
Parameter learned in Platt scaling when probability=True.
Parameter learned in Platt scaling when probability=True.
Returns quantum kernel
Methods
Evaluate the decision function for the samples in X.
fit
(X, y[, sample_weight])Fit the SVM model according to the given training data.
Get metadata routing of this object.
get_params
([deep])Get parameters for this estimator.
load
(file_name)Loads a model from the file.
predict
(X)Perform classification on samples in X.
Compute log probabilities of possible outcomes for samples in X.
Compute probabilities of possible outcomes for samples in X.
save
(file_name)Saves this model to the specified file.
score
(X, y[, sample_weight])Return the mean accuracy on the given test data and labels.
set_fit_request
(*[, sample_weight])Request metadata passed to the
fit
method.set_params
(**params)Set the parameters of this estimator.
set_score_request
(*[, sample_weight])Request metadata passed to the
score
method.