General Example

In this section, we will show a general example of the Helstrom Quantum Centroid (HQC) classifier using a randomly generated artificial dataset. We will consider a basic dataset with only two features, Feature 1 and Feature 2.

First, we will fit a HQC classification model to only two points (0, 0) and (1, 1).

We will then randomly generate points for Feature 1 and Feature 2 both from a uniform distribution between 0 and 1, and classify these points using the HQC classification model that we have built using the two points (0, 0) and (1, 1).

When we plot these points, we would expect that there would be a group of points grouped together close to (0, 0) and similarly a group of points grouped together close to (1, 1), rather than the points for the two groups being randomly scattered in the plot.

As expected, this is what we see when we plotted the points as shown in the scatterplot below.

Gallery generated by Sphinx-Gallery