Singularity Machine Learning - Classification: A Qiskit Function by Multiverse Computing
See the API reference
- Qiskit Functions are an experimental feature available only to IBM Quantum® Premium Plan, Flex Plan, and On-Prem (via IBM Quantum Platform API) Plan users. They are in preview release status and subject to change.
Overview
With the "Singularity Machine Learning - Classification" function, you can solve real-world machine learning problems on quantum hardware without requiring quantum expertise. This Application function, based on ensemble methods, is a hybrid classifier. It leverages classical methods like boosting, bagging, and stacking for initial ensemble training. Subsequently, quantum algorithms such as variational quantum eigensolver (VQE) and quantum approximate optimization algorithm (QAOA) are employed to enhance the trained ensemble's diversity, generalization capabilities, and overall complexity.
Unlike other quantum machine learning solutions, this function is capable of handling large-scale datasets with millions of examples and features without being limited by the number of qubits in the target QPU. The number of qubits only determines the size of the ensemble that can be trained. It is also highly flexible, and can be used to solve classification problems across a wide range of domains, including finance, healthcare, and cybersecurity.
It consistently achieves high accuracies on classically challenging problems involving high-dimensional, noisy, and imbalanced datasets.
It is built for:
- Engineers and data scientists at companies seeking to enhance their tech offerings by integrating quantum machine learning into their products and services,
- Researchers at quantum research labs exploring quantum machine learning applications and looking to leverage quantum computing for classification tasks, and
- Students and teachers at educational institutions in courses like machine learning, and who are looking to demonstrate the advantages of quantum computing.
The following example showcases its various functionalities, including create, list, fit, and predict, and demonstrates its usage in a synthetic problem comprising two interleaving half circles, a notoriously challenging problem due to its nonlinear decision boundary.
Function description
This Qiskit Function allows users to solve binary classification problems using Singularity's quantum-enhanced ensemble classifier. Behind the scenes, it uses a hybrid approach to classically train an ensemble of classifiers on the labeled dataset, and then optimize it for maximum diversity and generalization using the Quantum Approximate Optimization Algorithm (QAOA) on IBM® QPUs. Through a user-friendly interface, users can configure a classifier according to their requirements, train it on the dataset of their choice, and use it to make predictions on a previously unseen dataset.
To solve a generic classification problem:
- Preprocess the dataset, and split it into training and testing sets. Optionally, you can further split the training set into training and validation sets. This can be achieved using scikit-learn.
- If the training set is imbalanced, you can resample it to balance the classes using imbalanced-learn.
- Upload the training, validation, and test sets separately to the function's storage using the catalog's
file_uploadmethod, passing it the relevant path each time. - Initialize the quantum classifier by using the function's
createaction, which accepts hyperparameters such as the number and types of learners, the regularization (lambda value), and optimization options including the number of layers, the type of classical optimizer, the quantum backend, and so on. - Train the quantum classifier on the training set using the function's
fitaction, passing it the labeled training set, and the validation set if applicable. - Make predictions on the previously unseen test set using the function's
predictaction.
Get started
To learn how to load the function and run it, see Get started with Singularity Machine Learning.
Benchmarks
These benchmarks show that the classifier can achieve extremely high accuracies on challenging problems. They also show that increasing the number of learners in the ensemble (number of qubits) can lead to increased accuracy.
"Classical accuracy" refers to the accuracy obtained using corresponding classical state of the art which, in this case, is an AdaBoost classifier based on an ensemble of size 75. "Quantum accuracy", on the other hand, refers to the accuracy obtained using the "Singularity Machine Learning - Classification".
Problem | Dataset Size | Ensemble Size | Number of Qubits | Classical Accuracy | Quantum Accuracy | Improvement |
|---|---|---|---|---|---|---|
| Grid stability | 5000 examples, 12 features | 55 | 55 | 76% | 91% | 15% |
| Grid stability | 5000 examples, 12 features | 65 | 65 | 76% | 92% | 16% |
| Grid stability | 5000 examples, 12 features | 75 | 75 | 76% | 94% | 18% |
| Grid stability | 5000 examples, 12 features | 85 | 85 | 76% | 94% | 18% |
| Grid stability | 5000 examples, 12 features | 100 | 100 | 76% | 95% | 19% |
As quantum hardware evolves and scales, the implications for our quantum classifier become increasingly significant. While the number of qubits does impose limitations on the size of the ensemble that can be utilized, it does not restrict the volume of data that can be processed. This powerful capability enables the classifier to efficiently handle datasets containing millions of data points and thousands of features. Importantly, the constraints related to ensemble size can be addressed through the implementation of a large-scale version of the classifier. By leveraging an iterative outer-loop approach, the ensemble can be dynamically expanded, enhancing flexibility and overall performance. However, it's worth noting that this feature has not yet been implemented in the current version of the classifier.
Get support
For any questions, reach out to Multiverse Computing.
Be sure to include the following information:
- The Qiskit Function Job ID (
job.job_id) - A detailed description of the issue
- Any relevant error messages or codes
- Steps to reproduce the issue
Next steps
- Request access to Multiverse Computing's Singularity Machine Learning Classification function.
- Visit the API reference for this Qiskit Function.
- Review Leclerc, L., et al. (2023). Financial risk management on a neutral atom quantum processor. Physical Review Research, 5, 043117.