Abstract
In the last years, we have witnessed the increasing usage of machine learning technologies. In parallel, we have observed the raise of quantum computing, a paradigm for computing making use of quantum theory. Quantum computing can empower machine learning with theoretical properties allowing to overcome the limitations of classical computing. The translation of classical algorithms into their quantum counter-part is not trivial and hides many difficulties. We illustrate and implement alternatives for the quantum nearest neighbor classifier focusing on the challenges related to data preparation and their effect on the performance. We show that, with certain data preparation strategies, quantum algorithms are comparable with the classic version, yet allowing for a theoretical reduction of the complexity for distances calculation.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Python code available at: https://github.com/Brotherhood94/quantum_knn. We implemented QKNN using the qiskit library: https://qiskit.org/.
- 2.
https://scikit-learn.org/stable. For mnist we focus on the task of classification between “0” and “8”.
References
Afham, A., et al.: Quantum K-nearest neighbor machine learning algorithm. arXiv:2003.09187 (2020)
Brassard, G., et al.: Quantum amplitude amplification and estimation. Quantum Comput. Inf. 305, 53–74 (2002)
Dang, Y., Jiang, N., Hu, H., Ji, Z., Zhang, W.: Image classification based on quantum K-nearest-neighbor algorithm. Quantum Inf. Proc. 17(9), 239 (2018). https://doi.org/10.1007/s11128-018-2004-9
Dougherty, J., Kohavi, R., Sahami, M.: Supervised and unsupervised discretization of continuous features. In: ICML, pp. 194–202 (1995)
Durr, C., Hoyer, P.: A quantum algorithm for finding the minimum. arXiv preprint arXiv:quant-ph/9607014v2 (1999)
Kaye, P.: Reversible addition circuit using one ancillary bit with application to quantum computing. arXiv, p. 0408173, August 2004
Leskovec, J., et al.: Mining of Massive Datasets. Cambridge University Press, Cambridge (2014)
Li, J., Lin, S., Kai, Y., Guo, G.: Quantum K-nearest neighbor classification algorithm based on hamming distance. arXiv preprint arXiv:2103.04253 (2021)
Lloyd, S., Mohseni, M., Rebentrost, P.: Quantum algorithms for supervised and unsupervised machine learning. arXiv preprint arXiv:1307.0411 (2013)
Möttönen, M., et al.: Transformation of quantum states using uniformly controlled rotations. Quantum Inf. Com. 5, 467–473 (2005)
Nielsen, M., et al.: Quantum Computation and Quantum Information. CUP, Cambridge (2016)
Park, D.K., Petruccione, F., Rhee, J.-K.K.: Circuit-based quantum random access memory for classical data. Sci. Rep. 9(1), 1–8 (2019)
Ruan, Y., et al.: Quantum algorithm for K-nearest neighbors classification based on the metric of hamming distance. IJTP 56(11), 3496–3507 (2017)
Schuld, M., et al.: Implementing a distance-based classifier with a quantum interference circuit. EPL (Europhys. Lett.) 119(6), 60002 (2017)
Schuld, M., et al.: Supervised Learning with Quantum Computers. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-96424-9
Schuld, M., Sinayskiy, I., Petruccione, F.: Quantum computing for pattern classification. In: Pham, D.-N., Park, S.-B. (eds.) PRICAI 2014. LNCS (LNAI), vol. 8862, pp. 208–220. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-13560-1_17
Shende, V.V., Bullock, S.S., Markov, I.L.: Synthesis of quantum-logic circuits. IEEE Trans. Comput. Aided Des. Integr. Circ. Syst. 25(6), 1000–1010 (2006)
Tan, P., et al.: Introduction to Data Mining. Addison-Wesley, Boston (2005)
Ventura, D., et al.: Quantum associative memory. Inf. Sci. 124(1–4), 273–296 (2000)
Wiebe, N., Kapoor, A., Svore, K.M.: Quantum nearest-neighbor algorithms for machine learning. Quantum Inf. Comput. 15, 318–358 (2018)
Acknowledgment
This work is supported by Università di Pisa under the “PRA - Progetti di Ricerca di Ateneo” (Institutional Research Grants) - Pr. no. PRA_2020-2021_92, “Quantum Computing, Technologies and Applications”, and the work of Gianna Del Corso was supported also by GNCS-INdAM.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Berti, A., Bernasconi, A., Del Corso, G.M., Guidotti, R. (2022). Effect of Different Encodings and Distance Functions on Quantum Instance-Based Classifiers. In: Gama, J., Li, T., Yu, Y., Chen, E., Zheng, Y., Teng, F. (eds) Advances in Knowledge Discovery and Data Mining. PAKDD 2022. Lecture Notes in Computer Science(), vol 13281. Springer, Cham. https://doi.org/10.1007/978-3-031-05936-0_8
Download citation
DOI: https://doi.org/10.1007/978-3-031-05936-0_8
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-05935-3
Online ISBN: 978-3-031-05936-0
eBook Packages: Computer ScienceComputer Science (R0)