More on Naïve Bayes

Learn the basics of Naïve Bayes and calculate the prior probability.

We'll cover the following

Naïve Bayes is a probabilistic machine learning algorithm based on Bayes’ Theorem. Even though it’s simple, it has been successfully used in a wide variety of classification tasks.

We’ll tap the theoretical and practical knowledge we gathered in the last few chapters and use it to build a quantum Naïve Bayes classifier. Like the previous quantum classifier we introduced in the lesson Variational Hybrid Quantum Classical Algorithm, the quantum Naïve Bayes is a variational hybrid quantum-classical algorithm. It consists of three parts:

  • We pre-process the data on a classical computer to determine the modifiers for a set of features.
  • We apply the modifiers in a quantum circuit and measure the qubit that represents the posterior probability.
  • We post-process the measurement and transform it into a prediction that we evaluate with our training data set labels.

In the lesson Variational Hybrid Quantum Classical Algorithm, we used pre-processing to create the final quantum state, and we only used the quantum circuit to measure it. This time, we go beyond creating a simple quantum state to be measured, and also make a quantum circuit that includes the calculation of the probabilities.

The following figure shows the overall architecture of our simple variational hybrid quantum-classical algorithm.

Get hands-on with 1200+ tech skills courses.