⬡ Hub
Skip to content

5_QML_Classifier

Quantum Machine Learning (QML) Classifier

Description

This project implements a Quantum Machine Learning (QML) classifier to perform a classification task on a classical dataset. It uses a Variational Quantum Classifier (VQC), which is a hybrid quantum-classical algorithm.

This implementation uses Qiskit Machine Learning to build and train the QML classifier on a subset of the Iris dataset.

Setup

  1. Install Python: Make sure you have Python 3.6 or later installed.

  2. Install Qiskit and Scikit-learn: Open your terminal or command prompt and install the necessary libraries:

    bash pip install qiskit pip install qiskit-machine-learning pip install scikit-learn

How to Run

  1. Navigate to this directory in your terminal.

  2. Run the qml_classifier.py script:

    bash python qml_classifier.py

    The script will load the Iris dataset, preprocess it, build a VQC, train it on the training data, and then evaluate its performance on the test data, printing the accuracy.

Files and Subdirectories