Skip to content

Commit c6f4216

Browse files
adekusar-drlmanoelmarquesgentinettagianElePTwoodsp-ibm
authored
Update documentation (#509)
* Add primitives branch to CI workflow * added pocs * init fixed * more init * Add qnns PoC * Establish qnn branch * Add fwd unit test * Refactor sampler qnn * Undo kernel changes * Start adding new type hint style * Move to neural_networks * Runnable tests * Update typehints, refactor * Add new unittests, fix code * Add gradient unit test * Add torch tests * Remove unwanted change circuitQNN * Remove utils * Fix style, lint * Add VQC * Fix mypy * fix mypy * fix mypy * fix mypy * Restore workflow * Restore workflow * Update .github/workflows/main.yml * Fix mypy * Fix CI (hopefully) * Update requirements * Add sparse support * Fix style etc * Add type ignore * Fix style? * skip test if not sparse * Add type ignore * Fix mypy * Make keyword args * Make keyword args * Apply review comments * Fix tests, final refactor, add docstring * Add Sampler QNN * Update qiskit_machine_learning/algorithms/classifiers/vqc.py Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com> * Apply reviews vqc * Apply reviews * Fix neko test * Fix spell check * Update qiskit_machine_learning/neural_networks/sampler_qnn.py * Add try-catch * Add deprecations * Update tests * Fix tests * Filter warnings * Fix filter * fix black, pylint * update docstring * pulled the method up, modern type hints * fix spell * Update qiskit_machine_learning/neural_networks/sampler_qnn.py Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com> * Update qiskit_machine_learning/neural_networks/sampler_qnn.py Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com> * code review * update readme * update index * fix index * deprecate runtimes * update docs * update kernel docs * updated docs * migration guide * migration * fix spell * fix copyright * Disable running of stable tutorials for now * Disable running of stable tutorials for now * updated migration * fix black * fix spell * Enable CI stable tutorials * code review * fix spell * code review Co-authored-by: Manoel Marques <manoel.marques@ibm.com> Co-authored-by: Gian Gentinetta <gian.gentinetta@gmx.ch> Co-authored-by: ElePT <epenatap@gmail.com> Co-authored-by: ElePT <57907331+ElePT@users.noreply.github.com> Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
1 parent 3c22367 commit c6f4216

30 files changed

+1019
-108
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ jobs:
238238
wget https://codeload.github.com/Qiskit/qiskit-machine-learning/zip/stable/$version -O /tmp/repo.zip
239239
unzip /tmp/repo.zip -d /tmp/
240240
# copy stable tutorials to main tutorials
241-
rm -rf docs/tutorials/*
242241
cp -R /tmp/qiskit-machine-learning-stable-$version/docs/tutorials/* docs/tutorials
243242
# run tutorials and zip results
244243
echo "earliest_version: 0.1.0" >> releasenotes/config.yaml

.pylintdict

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
adam
22
adjoint
3+
aer
34
al
45
ancilla
56
ancillas
@@ -232,6 +233,7 @@ transpiles
232233
transpiling
233234
tunable
234235
uncompiled
236+
uncompute
235237
unitaries
236238
univariate
237239
unsymmetric

README.md

Lines changed: 25 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ without deep quantum computing knowledge. On the other hand, Qiskit Machine Lear
99
and users can easily extend it to support cutting-edge quantum machine learning research.
1010

1111
Qiskit Machine Learning provides the
12-
[QuantumKernel](https://qiskit.org/documentation/machine-learning/stubs/qiskit_machine_learning.kernels.QuantumKernel.html#qiskit_machine_learning.kernels.QuantumKernel)
13-
class that can be easily used to directly compute
12+
[FidelityQuantumKernel](https://qiskit.org/documentation/machine-learning/stubs/qiskit_machine_learning.kernels.QuantumKernel.html#qiskit_machine_learning.kernels.FidelityQuantumKernel)
13+
class that makes use of the [Fidelity](https://qiskit.org/documentation/stubs/qiskit.algorithms.state_fidelities.BaseStateFidelity.html) algorithm introduced in Qiskit and can be easily used to directly compute
1414
kernel matrices for given datasets or can be passed to a Quantum Support Vector Classifier
1515
[QSVC](https://qiskit.org/documentation/machine-learning/stubs/qiskit_machine_learning.algorithms.QSVC.html#qiskit_machine_learning.algorithms.QSVC) or
1616
Quantum Support Vector Regressor
@@ -20,25 +20,17 @@ It also can be used with many other existing kernel-based machine learning algor
2020
classical frameworks.
2121

2222
Qiskit Machine Learning defines a generic interface for neural networks that is implemented by different
23-
quantum neural networks. Multiple implementations are readily provided, such as the
24-
[OpflowQNN](https://qiskit.org/documentation/machine-learning/stubs/qiskit_machine_learning.neural_networks.OpflowQNN.html#qiskit_machine_learning.neural_networks.OpflowQNN),
25-
the [TwoLayerQNN](https://qiskit.org/documentation/machine-learning/stubs/qiskit_machine_learning.neural_networks.TwoLayerQNN.html#qiskit_machine_learning.neural_networks.TwoLayerQNN),
26-
and the
27-
[CircuitQNN](https://qiskit.org/documentation/machine-learning/stubs/qiskit_machine_learning.neural_networks.CircuitQNN.html#qiskit_machine_learning.neural_networks.CircuitQNN).
28-
The [OpflowQNN](https://qiskit.org/documentation/machine-learning/stubs/qiskit_machine_learning.neural_networks.OpflowQNN.html#qiskit_machine_learning.neural_networks.OpflowQNN)
29-
allows users to combine parametrized quantum circuits
30-
with quantum mechanical observables. The circuits can be constructed using, for example, building blocks
23+
quantum neural networks. Two core implementations are readily provided, such as the
24+
[EstimatorQNN](https://qiskit.org/documentation/machine-learning/stubs/qiskit_machine_learning.neural_networks.EstimatorQNN.html),
25+
and the [SamplerQNN](https://qiskit.org/documentation/machine-learning/stubs/qiskit_machine_learning.neural_networks.SamplerQNN.html).
26+
The [EstimatorQNN](https://qiskit.org/documentation/machine-learning/stubs/qiskit_machine_learning.neural_networks.EstimatorQNN.html)
27+
leverages the [Estimator](https://qiskit.org/documentation/stubs/qiskit.primitives.BaseEstimator.html) primitive from Qiskit and
28+
allows users to combine parametrized quantum circuits with quantum mechanical observables. The circuits can be constructed using, for example, building blocks
3129
from Qiskit’s circuit library, and the QNN’s output is given by the expected value of the observable.
32-
The [TwoLayerQNN](https://qiskit.org/documentation/machine-learning/stubs/qiskit_machine_learning.neural_networks.TwoLayerQNN.html#qiskit_machine_learning.neural_networks.TwoLayerQNN) is a special case of the
33-
[OpflowQNN](https://qiskit.org/documentation/machine-learning/stubs/qiskit_machine_learning.neural_networks.OpflowQNN.html#qiskit_machine_learning.neural_networks.OpflowQNN)
34-
that takes as input a feature map and an ansatz.
35-
The [CircuitQNN](https://qiskit.org/documentation/machine-learning/stubs/qiskit_machine_learning.neural_networks.CircuitQNN.html#qiskit_machine_learning.neural_networks.CircuitQNN) directly takes the quantum circuit’s
36-
measurements as output without an observable.
37-
The output can be used either as a batch of samples, i.e., a list of bitstrings measured from the circuit’s
38-
qubits, or as a sparse vector of the resulting sampling probabilities for each bitstring. The former is of
39-
interest in learning distributions resulting from a given quantum circuit, while the latter finds application,
40-
e.g., in regression or classification. A post-processing step can be used to interpret a given bitstring in
41-
a particular context, e.g. translating it into a set of classes.
30+
The [SamplerQNN](https://qiskit.org/documentation/machine-learning/stubs/qiskit_machine_learning.neural_networks.SamplerQNN.html)
31+
leverages another primitive introduced in Qiskit, the [Sampler](https://qiskit.org/documentation/stubs/qiskit.primitives.BaseSampler.html) primitive.
32+
This neural network translates quasi-probabilities of bitstrings estimated by the primitive into a desired output. This
33+
translation step can be used to interpret a given bitstring in a particular context, e.g. translating it into a set of classes.
4234

4335
The neural networks include the functionality to evaluate them for a given input as well as to compute the
4436
corresponding gradients, which is important for efficient training. To train and use neural networks,
@@ -57,7 +49,7 @@ In addition to the models provided directly in Qiskit Machine Learning, it has t
5749
[TorchConnector](https://qiskit.org/documentation/machine-learning/stubs/qiskit_machine_learning.connectors.TorchConnector.html#qiskit_machine_learning.connectors.TorchConnector),
5850
which allows users to integrate all of our quantum neural networks directly into the
5951
[PyTorch](https://pytorch.org)
60-
open source machine learning library. Thanks to Qiskit’s gradient framework, this includes automatic
52+
open source machine learning library. Thanks to Qiskit’s gradient algorithms, this includes automatic
6153
differentiation - the overall gradients computed by [PyTorch](https://pytorch.org)
6254
during the backpropagation take into
6355
account quantum neural networks, too. The flexible design also allows the building of connectors
@@ -99,10 +91,10 @@ train and test samples from a data set to see how accurately the test set can
9991
be classified.
10092

10193
```python
102-
from qiskit import BasicAer
103-
from qiskit.utils import QuantumInstance, algorithm_globals
10494
from qiskit.algorithms.optimizers import COBYLA
10595
from qiskit.circuit.library import TwoLocal, ZZFeatureMap
96+
from qiskit.utils import algorithm_globals
97+
10698
from qiskit_machine_learning.algorithms import VQC
10799
from qiskit_machine_learning.datasets import ad_hoc_data
108100

@@ -114,22 +106,19 @@ feature_dim = 2 # dimension of each data point
114106
training_size = 20
115107
test_size = 10
116108

117-
# training features, training labels, test features, test labels as np.array,
109+
# training features, training labels, test features, test labels as np.ndarray,
118110
# one hot encoding for labels
119-
training_features, training_labels, test_features, test_labels = \
120-
ad_hoc_data(
121-
training_size=training_size, test_size=test_size, n=feature_dim, gap=0.3)
111+
training_features, training_labels, test_features, test_labels = ad_hoc_data(
112+
training_size=training_size, test_size=test_size, n=feature_dim, gap=0.3
113+
)
122114

123115
feature_map = ZZFeatureMap(feature_dimension=feature_dim, reps=2, entanglement="linear")
124-
ansatz = TwoLocal(feature_map.num_qubits, ['ry', 'rz'], 'cz', reps=3)
125-
vqc = VQC(feature_map=feature_map,
126-
ansatz=ansatz,
127-
optimizer=COBYLA(maxiter=100),
128-
quantum_instance=QuantumInstance(BasicAer.get_backend('statevector_simulator'),
129-
shots=1024,
130-
seed_simulator=seed,
131-
seed_transpiler=seed)
132-
)
116+
ansatz = TwoLocal(feature_map.num_qubits, ["ry", "rz"], "cz", reps=3)
117+
vqc = VQC(
118+
feature_map=feature_map,
119+
ansatz=ansatz,
120+
optimizer=COBYLA(maxiter=100),
121+
)
133122
vqc.fit(training_features, training_labels)
134123

135124
score = vqc.score(test_features, test_labels)

docs/index.rst

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,30 @@ On the one hand, this design is very easy to use and allows users to rapidly pro
1111
without deep quantum computing knowledge. On the other hand, Qiskit Machine Learning is very flexible,
1212
and users can easily extend it to support cutting-edge quantum machine learning research.
1313

14-
Qiskit Machine Learning provides the :class:`~qiskit_machine_learning.kernels.QuantumKernel`
15-
class that can be easily used to directly compute
16-
kernel matrices for given datasets or can be passed to a Quantum Support Vector Classifier
14+
Qiskit Machine Learning provides the :class:`~qiskit_machine_learning.kernels.FidelityQuantumKernel`
15+
class class that makes use of the :class:`~qiskit.algorithms.state_fidelities.BaseStateFidelity` algorithm
16+
introduced in Qiskit and can be easily used to directly compute kernel matrices for given datasets
17+
or can be passed to a Quantum Support Vector Classifier
1718
(:class:`~qiskit_machine_learning.algorithms.QSVC`) or
1819
Quantum Support Vector Regressor (:class:`~qiskit_machine_learning.algorithms.QSVR`)
1920
to quickly start solving classification or regression problems.
2021
It also can be used with many other existing kernel-based machine learning algorithms from established
2122
classical frameworks.
2223

2324
Qiskit Machine Learning defines a generic interface for neural networks that is implemented by different
24-
quantum neural networks. Multiple implementations are readily provided, such as the
25-
:class:`~qiskit_machine_learning.neural_networks.OpflowQNN`,
26-
the :class:`~qiskit_machine_learning.neural_networks.TwoLayerQNN`,
27-
and the :class:`~qiskit_machine_learning.neural_networks.CircuitQNN`.
28-
The :class:`~qiskit_machine_learning.neural_networks.OpflowQNN` allows users to combine parametrized quantum circuits
29-
with quantum mechanical observables. The circuits can be constructed using, for example, building blocks
30-
from Qiskit’s circuit library, and the QNN’s output is given by the expected value of the observable.
31-
The :class:`~qiskit_machine_learning.neural_networks.TwoLayerQNN` is a special case of the
32-
:class:`~qiskit_machine_learning.neural_networks.OpflowQNN` that takes as input a feature map and an ansatz.
33-
The :class:`~qiskit_machine_learning.neural_networks.CircuitQNN` directly takes the quantum circuit’s
34-
measurements as output without an observable.
35-
The output can be used either as a batch of samples, i.e., a list of bitstrings measured from the circuit’s
36-
qubits, or as a sparse vector of the resulting sampling probabilities for each bitstring. The former is of
37-
interest in learning distributions resulting from a given quantum circuit, while the latter finds application,
38-
e.g., in regression or classification. A post-processing step can be used to interpret a given bitstring in
39-
a particular context, e.g. translating it into a set of classes.
25+
quantum neural networks. Two core implementations are readily provided, such as the
26+
:class:`~qiskit_machine_learning.neural_networks.EstimatorQNN`
27+
and the :class:`~qiskit_machine_learning.neural_networks.SamplerQNN`.
28+
The :class:`~qiskit_machine_learning.neural_networks.EstimatorQNN` leverages
29+
the :class:`~qiskit.primitives.BaseEstimator` primitive from Qiskit and allows users to combine
30+
parametrized quantum circuits with quantum mechanical observables. The circuits can be constructed
31+
using, for example, building blocks from Qiskit's circuit library, and the QNN's output is given
32+
by the expected value of the observable.
33+
The :class:`~qiskit_machine_learning.neural_networks.SamplerQNN` leverages another primitive
34+
introduced in Qiskit, the :class:`~qiskit.primitives.BaseSampler` primitive. This neural network
35+
translates quasi-probabilities of bitstrings estimated by the primitive into a desired output. This
36+
translation step can be used to interpret a given bitstring in a particular context, e.g.
37+
translating it into a set of classes.
4038

4139
The neural networks include the functionality to evaluate them for a given input as well as to compute the
4240
corresponding gradients, which is important for efficient training. To train and use neural networks,
@@ -53,7 +51,7 @@ In addition to the models provided directly in Qiskit Machine Learning, it has t
5351
:class:`~qiskit_machine_learning.connectors.TorchConnector`,
5452
which allows users to integrate all of our quantum neural networks directly into the
5553
`PyTorch <https://pytorch.org>`__
56-
open source machine learning library. Thanks to Qiskits gradient framework, this includes automatic
54+
open source machine learning library. Thanks to Qiskit's gradient algorithms, this includes automatic
5755
differentiation - the overall gradients computed by `PyTorch <https://pytorch.org>`__
5856
during the backpropagation take into
5957
account quantum neural networks, too. The flexible design also allows the building of connectors
@@ -66,13 +64,16 @@ Next Steps
6664

6765
`Getting started <getting_started.html>`_
6866

67+
`Migration Guide <migration/index.html>`_
68+
6969
`Tutorials <tutorials/index.html>`_
7070

7171
.. toctree::
7272
:hidden:
7373

7474
Overview <self>
7575
Getting Started <getting_started>
76+
Migration Guide <migration/index>
7677
Tutorials <tutorials/index>
7778
API Reference <apidocs/qiskit_machine_learning>
7879
Release Notes <release_notes>

docs/migration/01_migration_guide_0.5.ipynb

Lines changed: 885 additions & 0 deletions
Large diffs are not rendered by default.

docs/migration/index.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#######################################
2+
Qiskit Machine Learning Migration Guide
3+
#######################################
4+
5+
6+
.. nbgallery::
7+
:glob:
8+
9+
*
10+
11+
12+
.. Hiding - Indices and tables
13+
:ref:`genindex`
14+
:ref:`modindex`
15+
:ref:`search`
16+

qiskit_machine_learning/algorithms/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
# that they have been altered from the originals.
1212

1313
"""
14-
Algorithms (:mod:`qiskit_machine_learning.algorithms`)
14+
Quantum machine learning algorithms (:mod:`qiskit_machine_learning.algorithms`)
15+
===============================================================================
16+
17+
The package contains core algorithms such as classifiers and classifiers.
1518
1619
.. currentmodule:: qiskit_machine_learning.algorithms
1720

qiskit_machine_learning/algorithms/classifiers/neural_network_classifier.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737

3838

3939
class NeuralNetworkClassifier(TrainableModel, ClassifierMixin):
40-
"""Quantum neural network classifier. Implements Scikit-Learn compatible methods for
41-
classification and extends ``ClassifierMixin``. See `Scikit-Learn <https://scikit-learn.org>`__
42-
for more details.
40+
"""Implements a basic quantum neural network classifier. Implements Scikit-Learn compatible
41+
methods for classification and extends ``ClassifierMixin``.
42+
See `Scikit-Learn <https://scikit-learn.org>`__ for more details.
4343
"""
4444

4545
def __init__(

qiskit_machine_learning/algorithms/classifiers/pegasos_qsvc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@
3131

3232
class PegasosQSVC(ClassifierMixin, SerializableModelMixin):
3333
r"""
34-
This class implements Pegasos Quantum Support Vector Classifier algorithm developed in [1]
35-
and includes methods ``fit``, ``predict`` and ``decision_function`` following the signatures
34+
Implements Pegasos Quantum Support Vector Classifier algorithm. The algorithm has been
35+
developed in [1] and includes methods ``fit``, ``predict`` and ``decision_function`` following
36+
the signatures
3637
of `sklearn.svm.SVC <https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html>`_.
3738
This implementation is adapted to work with quantum kernels.
3839

qiskit_machine_learning/algorithms/classifiers/qsvc.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@
2424

2525

2626
class QSVC(SVC, SerializableModelMixin):
27-
r"""Quantum Support Vector Classifier.
27+
r"""Quantum Support Vector Classifier that extends the scikit-learn
28+
`sklearn.svm.SVC <https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html>`_
29+
classifier and introduces an additional `quantum_kernel` parameter.
2830
29-
This class shows how to use a quantum kernel for classification. The class extends
30-
`sklearn.svm.SVC <https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html>`_,
31-
and thus inherits its methods like ``fit`` and ``predict`` used in the example below.
32-
Read more in the `sklearn user guide
31+
This class shows how to use a quantum kernel for classification. The class inherits its methods
32+
like ``fit`` and ``predict`` from scikit-learn, see the example below.
33+
Read more in the `scikit-learn user guide
3334
<https://scikit-learn.org/stable/modules/svm.html#svm-classification>`_.
3435
3536
**Example**

qiskit_machine_learning/algorithms/classifiers/vqc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131

3232

3333
class VQC(NeuralNetworkClassifier):
34-
r"""Variational quantum classifier.
34+
r"""A convenient Variational Quantum Classifier implementation.
3535
3636
The variational quantum classifier (VQC) is a variational algorithm where the measured
37-
expectation value is interpreted as the output of a classifier.
37+
bitstrings are interpreted as the output of a classifier.
3838
3939
Constructs a quantum circuit and corresponding neural network, then uses it to instantiate a
4040
neural network classifier.

qiskit_machine_learning/algorithms/objective_functions.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ def _neural_network_forward(self, weights: np.ndarray) -> Union[np.ndarray, Spar
107107

108108

109109
class BinaryObjectiveFunction(ObjectiveFunction):
110-
"""An objective function for binary representation of the output,
111-
e.g. classes of ``-1`` and ``+1``."""
110+
"""An objective function for binary representation of the output. For instance, classes of
111+
``-1`` and ``+1``."""
112112

113113
def objective(self, weights: np.ndarray) -> float:
114114
# predict is of shape (N, 1), where N is a number of samples
@@ -143,8 +143,8 @@ def gradient(self, weights: np.ndarray) -> np.ndarray:
143143

144144
class MultiClassObjectiveFunction(ObjectiveFunction):
145145
"""
146-
An objective function for multiclass representation of the output,
147-
e.g. classes of ``0``, ``1``, ``2``, etc.
146+
An objective function for multiclass representation of the output. For instance, classes of
147+
``0``, ``1``, ``2``, etc.
148148
"""
149149

150150
def objective(self, weights: np.ndarray) -> float:
@@ -182,8 +182,8 @@ def gradient(self, weights: np.ndarray) -> np.ndarray:
182182

183183
class OneHotObjectiveFunction(ObjectiveFunction):
184184
"""
185-
An objective function for one hot encoding representation of the output,
186-
e.g. classes like ``[1, 0, 0]``, ``[0, 1, 0]``, ``[0, 0, 1]``.
185+
An objective function for one hot encoding representation of the output. For instance, classes
186+
like ``[1, 0, 0]``, ``[0, 1, 0]``, ``[0, 0, 1]``.
187187
"""
188188

189189
def objective(self, weights: np.ndarray) -> float:

qiskit_machine_learning/algorithms/regressors/neural_network_regressor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626

2727

2828
class NeuralNetworkRegressor(TrainableModel, RegressorMixin):
29-
"""Quantum neural network regressor. Implements Scikit-Learn compatible methods for
30-
regression and extends ``RegressorMixin``. See `Scikit-Learn <https://scikit-learn.org>`__
31-
for more details.
29+
"""Implements a basic quantum neural network regressor. Implements Scikit-Learn compatible
30+
methods for regression and extends ``RegressorMixin``.
31+
See `Scikit-Learn <https://scikit-learn.org>`__ for more details.
3232
"""
3333

3434
def _fit_internal(

qiskit_machine_learning/algorithms/regressors/qsvr.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@
2323

2424

2525
class QSVR(SVR, SerializableModelMixin):
26-
r"""Quantum Support Vector Regressor.
26+
r"""Quantum Support Vector Regressor that extends the scikit-learn
27+
`sklearn.svm.SVR <https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVR.html>`_
28+
regressor and introduces an additional `quantum_kernel` parameter.
2729
28-
This class shows how to use a quantum kernel for regression. The class extends
29-
`sklearn.svm.SVR <https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVR.html>`_,
30-
and thus inherits its methods like ``fit`` and ``predict`` used in the example below.
30+
This class shows how to use a quantum kernel for regression. The class inherits its methods
31+
like ``fit`` and ``predict`` from scikit-learn, see the example below.
3132
Read more in the
32-
`sklearn user guide <https://scikit-learn.org/stable/modules/svm.html#svm-regression>`_.
33+
`scikit-learn user guide <https://scikit-learn.org/stable/modules/svm.html#svm-regression>`_.
3334
3435
**Example**
3536

0 commit comments

Comments
 (0)