Tamil
மொழிகள்
English
Bengali
French
Hindi
Japanese
Korean
Russian
Spanish
Tamil
Turkish



QSVR

class QSVR(*, quantum_kernel=None, **kwargs)[source]

Bases: SVR, SerializableModelMixin

Quantum Support Vector Regressor that extends the scikit-learn sklearn.svm.SVR regressor and introduces an additional quantum_kernel parameter.

This class shows how to use a quantum kernel for regression. 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

qsvr = QSVR(quantum_kernel=qkernel)
qsvr.fit(sample_train,label_train)
qsvr.predict(sample_test)
Parameters:
  • quantum_kernel (BaseKernel | None) -- Quantum kernel to be used for regression.

  • *args -- Variable length argument list to pass to SVR constructor.

  • **kwargs -- Arbitrary keyword arguments to pass to SVR constructor.

Attributes

class_weight_

coef_

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

n_support_

Number of support vectors for each class.

quantum_kernel

Returns quantum kernel

unused_param

Methods

fit(X, y[, sample_weight])

Fit the SVM model according to the given training data.

get_metadata_routing()

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 regression on samples in X.

save(file_name)

Saves this model to the specified file.

score(X, y[, sample_weight])

Return the coefficient of determination of the prediction.

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.