Metadata-Version: 2.4
Name: tno.quantum.ml.classifiers.vc
Version: 3.0.1
Summary: Quantum VC module
Author-email: TNO Quantum Code Lab <tnoquantum@tno.nl>
Maintainer-email: TNO Quantum Code Lab <tnoquantum@tno.nl>
License: Apache License, Version 2.0
Project-URL: Homepage, https://github.com/TNO-Quantum/
Project-URL: Documentation, https://tno-quantum.github.io/documentation/
Project-URL: Source, https://github.com/TNO-Quantum/ml.classifiers.vc
Keywords: TNO,Quantum
Platform: any
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tno.quantum.utils~=5.1
Requires-Dist: scikit-learn~=1.6
Requires-Dist: numpy
Requires-Dist: pennylane
Requires-Dist: torch
Requires-Dist: torchtyping
Requires-Dist: tqdm
Requires-Dist: networkx<=3.2.1; python_version == "3.9"
Provides-Extra: tests
Requires-Dist: pytest>=8.1.1; extra == "tests"
Requires-Dist: pytest-cov>=4.1.0; extra == "tests"
Requires-Dist: tomlkit; extra == "tests"
Requires-Dist: pandas; extra == "tests"
Requires-Dist: tno.quantum.ml.datasets; extra == "tests"
Requires-Dist: pennylane-qiskit>=0.41; python_version < "3.13" and extra == "tests"
Dynamic: license-file

# TNO Quantum: Variational classifier

TNO Quantum provides generic software components aimed at facilitating the development
of quantum applications.

The `tno.quantum.ml.classifiers.vc` package provides a `VariationalClassifier` class, which has been implemented 
in accordance with the
[scikit-learn estimator API](https://scikit-learn.org/stable/developers/develop.html).
This means that the classifier can be used as any other (binary and multiclass)
scikit-learn classifier and combined with transforms through
[Pipelines](https://scikit-learn.org/stable/modules/generated/sklearn.pipeline.Pipeline.html).
In addition, the `VariationalClassifier` makes use of
[PyTorch](https://pytorch.org/docs/stable/tensors.html) tensors, optimizers, and loss
functions.

*Limitations in (end-)use: the content of this software package may solely be used for applications that comply with international export control laws.*

## Documentation

Documentation of the `tno.quantum.ml.classifiers.vc` package can be found [here](https://tno-quantum.github.io/documentation/).


## Install

Easily install the `tno.quantum.ml.classifiers.vc` package using pip:

```console
$ python -m pip install tno.quantum.ml.classifiers.vc
```

If you wish to run the tests you can use:
```console
$ python -m pip install 'tno.quantum.ml.classifiers.vc[tests]'
```

## Example

Here's an example of how the `VariationalClassifier` class can be used for
classification based on the
[Iris dataset](https://en.wikipedia.org/wiki/Iris_flower_data_set):
Note that `tno.quantum.ml.datasets` is required for this example.

```python
from tno.quantum.ml.classifiers.vc import VariationalClassifier
from tno.quantum.ml.datasets import get_iris_dataset

X_training, y_training, X_validation, y_validation = get_iris_dataset()
vc = VariationalClassifier().fit(X_training, y_training, n_iter=5)
predictions = vc.predict(X_validation)
```
