Skip to main content

Quantum decision trees with binary features and binary classes

Project description

GitHub Actions Documentation Status MIT License

This Python package implements quantum decision tree classifiers for binary data. The details of the method can be found in Representation of binary classification trees with binary features by quantum circuits

Installation

Install via pip or clone this repository. In order to use pip, type:

$ pip install quantum-tree

Usage

Minimal working example:

# create quantum tree instance
from qtree.qtree import QTree
qtree = QTree(max_depth=1)

# create simple training data
import numpy as np
X = np.array([[1,0,0], [0,1,0], [0,0,1]]) # features
y = np.array([[0,0], [0,1], [1,1]])       # labels

# fit quantum tree
qtree.fit(X, y)

# make quantum tree prediction
qtree.predict([[0,0,1]])

Documentation

Documentation is available on https://qtree.readthedocs.io/en/latest.

Demo notebooks can be found in the examples/ directory.

📖 Citation

If you find this code useful in your research, please consider citing:

@article{Heese2022representationof,
         doi = {10.22331/q-2022-03-30-676},
         url = {https://doi.org/10.22331/q-2022-03-30-676},
         title = {Representation of binary classification trees with binary features by quantum circuits},
         author = {Heese, Raoul and Bickert, Patricia and Niederle, Astrid Elisa},
         journal = {{Quantum}},
         issn = {2521-327X},
         publisher = {{Verein zur F{\"{o}}rderung des Open Access Publizierens in den Quantenwissenschaften}},
         volume = {6},
         pages = {676},
         month = {3},
         year = {2022}
        }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quantum-tree-1.1.tar.gz (27.4 kB view hashes)

Uploaded Source

Built Distribution

quantum_tree-1.1-py3-none-any.whl (27.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page