Predict Survival
Explore how to predict passenger survival by applying a variational quantum-classical algorithm in a quantum Bayesian network. Learn data pre-processing, applying quantum gates based on passenger attributes, training the quantum Bayesian network, and interpreting output measurements to improve classification outcomes.
Let’s see how it performs on predicting the survival of the passengers.
We’ll apply our proven procedure of a variational quantum-classical algorithm. We’ll start with pre-processing the data to prepare a quantum state, evaluate the quantum state, and post-process the measurement.
Pre‐processing
The pre-processing is quite simple.
We’ll take the entry of a passenger and return a tuple of whether the value of IsChild is 1, the value of Sex is female, and the ticket-class. We’ll apply these three values in the quantum circuit.
Applying the known data on the quantum circuit
If the passenger is a child, we apply an -gate on the qubit at the position QPOS_ISCHILD in lines 2-3. Since Qiskit initializes the qubits in-state ...