This repository contains code and resources for a comparative study between Quantum Support Vector Classification (QSVC) and classical Support Vector Classification (SVC) using an ad hoc dataset.
This project aims to demonstrate the application of quantum machine learning algorithms and compare their performance against classical machine learning algorithms. We utilize the Qiskit framework for quantum machine learning and scikit-learn for classical machine learning.
- Python 3.7 or higher
- Qiskit
- scikit-learn
- numpy
- matplotlib
To set up the environment, follow these steps:
- Clone the repository:
git clone https://github.com/your-username/quantum-vs-classical-ml.git
cd quantum-vs-classical-ml- Install the required packages:
pip install -r requirements.txtThe quantum_ml.py script demonstrates the quantum support vector classification. It includes the following steps:
- Data preparation using the
respiratory datafunction from Qiskit. - Creation of a parameterized quantum circuit for the feature map.
- Optimization of the quantum kernel using the SPSA optimizer.
- Training the QSVC model with the optimized kernel.
- Evaluation of the QSVC model's performance.
To run the quantum machine learning script:
python quantum_ml.pyThe classical_ml.py script demonstrates classical support vector classification using scikit-learn. It includes the following steps:
- Data preparation using the same
respiratory datafunction for consistency. - Training the classical SVC model.
- Evaluation of the SVC model's performance.
To run the classical machine learning script:
python classical_ml.pyThis project provides a comprehensive comparison between quantum and classical machine learning models using a synthetic dataset. It highlights the potential and current limitations of quantum machine learning algorithms.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or new features.
This project is licensed under the MIT License. See the LICENSE file for details.
- Qiskit for providing the quantum computing framework.
- scikit-learn for the classical machine learning tools.
Feel free to modify the content as per your requirements. Happy coding!
