Hindi
भाषाएँ
English
Bengali
French
Hindi
Japanese
Korean
Russian
Spanish
Tamil
Turkish



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 and predict 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

coef_

Weights assigned to the features when kernel="linear".

n_support_

Number of support vectors for each class.

probA_

Parameter learned in Platt scaling when probability=True.

probB_

Parameter learned in Platt scaling when probability=True.

quantum_kernel

Returns quantum kernel

unused_param

Methods

decision_function(X)

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_params([deep])

Get parameters for this estimator.

load(file_name)

Loads a model from the file.

predict(X)

Perform classification on samples in X.

predict_log_proba(X)

Compute log probabilities of possible outcomes for samples in X.

predict_proba(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_params(**params)

Set the parameters of this estimator.