Package: hqc
Helstrom Quantum Centroid ClassifierThe Helstrom Quantum Centroid (HQC) classifier is a quantum-inspired supervised classification approach for data with binary classes (ie. data with 2 classes only). By quantum-inspired, we mean a classification process which employs and exploits Quantum Theory.It is inspired by thequantum Helstrom observablewhich acts on the distinguishability between quantum patterns rather than classical patterns of a dataset.The HQC classifier is based on research undertaken by Giuseppe Sergioli, Roberto Giuntini and Hector Freytes, in their paper:Sergioli G, Giuntini R, Freytes H (2019) A new quantum approach to binary classification. PLoS ONE 14(5): e0216224.
https://doi.org/10.1371/journal.pone.0216224This Python package includes the option to vary four hyperparameters which are used to optimize the performance of the HQC classifier:There is an option to rescale the dataset.There are two options to choose how the classical dataset is encoded into quantum densities:inverse of the standard stereographic projectionoramplitudeencoding method.There is an option to choose the number of copies to take for the quantum densities.There are two options to assign class weights to the quantum Helstrom observable terms:equiprobableorweighted.These hyperparameters are used in combination together to hypertune and optimize the accuracy of the HQC classifier to a given dataset.The package also includes an option for parallel computing using Joblib and an option to split datasets into subsets or batches for optimal speed performance. Parallelization is performed over the two classes and subset splits or batches.It is shown inthe paper by Sergioli G, Giuntini R and Freytes Hthat the HQC classifier, on average,outperformsa variety of commonly used classifiers over 14 real-world and artificial datasets, in particular when the hyperparameter,number of copies, is increased. A summary of the performances of the different classifiers examined are shown in the table below:RankClassifierAverage Success Rate (%)1HelstromQuantumCentroid472.802HelstromQuantumCentroid365.133GaussianNB58.004HelstromQuantumCentroid257.075HelstromQuantumCentroid156.605QuadraticDiscriminantAnalysis56.606GradientBoostingClassifier52.737ExtraTreesClassifier51.938KNeighborsClassifier51.479NearestCentroid49.1310RandomForestClassifier45.8711QuantumNearestMeanCentroid43.9312AdaBoostClassifier42.9313LinearDiscriminantAnalysis42.0014LogisticRegression36.4015BernoulliNB17.40*Average success rate is the average number of datasets where the specified classifier outperforms the other classifiers over 14 real-world and artificial datasets. HelstromQuantumCentroidn is the HQC classifier corresponding to the nnumber of copiestaken for the quantum densities.The HQC classifier is atrue probabilisticclassifier, ie. a classifier which gives the class membership probability estimates for each sample without having to use any scaling methods. This means that the probability estimates (frompredict_proba) are consistent with the scores (frompredict).Source CodeThe Python package's source code for the HQC classifier is available here:https://github.com/leockl/helstrom-quantum-centroid-classifier/blob/master/hqc/hqc.pyDocumentationThe documentation, including how to install the Python package, how to use the Python package and how the HQC classifier algorithm works, are available here:https://helstrom-quantum-centroid-classifier.readthedocs.io/en/latest/LicenseThis Python package is licensed under the BSD 3-Clause License, available here:https://github.com/leockl/helstrom-quantum-centroid-classifier/blob/master/LICENSEReferencesSergioli G, Giuntini R, Freytes H (2019) A new quantum approach to binary classification. PLoS ONE 14(5): e0216224.https://doi.org/10.1371/journal.pone.0216224