# Introduction to Quantum Bayesian Networks

Learn about the quantum Naïve Bayes classifier.

Bayes’ Theorem helps us build a classifier capable of predicting the survival of a passenger aboard the Titanic. However, the quantum Naïve Bayes classifier we created in the chapter Introduction to Naïve Bayes includes two features only. Yet, we’re already moving on the edge of the possible. While handling modifiers below $1.0$ that reduce the prior probability is easy, those above $1.0$ are difficult to handle.

Altogether, our quantum Naïve Bayes classifier has quite a few shortcomings.

- Most of the work remains at the classical part. We need to consult the data for each passenger to get the backward probability and the marginal probability of the evidence. For each passenger, we calculate the corresponding modifiers.
- We calculate the same modifiers over and over again. We do not reuse the results.
- We construct a completely new quantum circuit for each unique combination of passenger attributes. For example, the circuit of a female passenger with a first-class ticket looks quite different from a male passenger’s circuit with a third-class ticket. This is error-prone and hard to debug. We programmed quite a lot of logic in Python.

The first figure depicts the quantum circuit of a male passenger with a third-class ticket. The second figure depicts the circuit of a female passenger with a first-class ticket.

How we specify the prior probability is similar in both circuits, but we apply the modifiers in entirely different ways.

Get hands-on with 1200+ tech skills courses.