Quantum decision trees with binary features and binary classes
Project description
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
Release history Release notifications | RSS feed
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)
Built Distribution
quantum_tree-1.1-py3-none-any.whl
(27.8 kB
view hashes)
Close
Hashes for quantum_tree-1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f83e8bb00537a6fc45cff34070954abb4750ad7cba92d394d18dc9a0e12a2292 |
|
MD5 | 08420da909fa5af361cc4659e120cf83 |
|
BLAKE2b-256 | 5ff8fc99def08a1d5e9a9d3dfaedb24a2d32647239c553985741eb5047181e29 |