The Weighting Pre‐processing
Learn how we can implement and run weighting pre-processing.
We use the function get_state
from the lesson Visual Exploration of the Qubit State.
It takes the angle theta
and returns a valid quantum state. An angle of denotes the state , which is the
probability of measuring 0
. An denotes the state , the probability of measuring 1
.
Accordingly, we multiply the overall probability we calculate at line 14 with pi
to specify an angle up to in line 17. Since the correlation coefficients are between -1
and 1
and most of our coefficients are negative, a value of towards -1
implies that the passenger died. Thus, we reverse the angles by calculating (1-mu)*pi
.
Get hands-on with 1400+ tech skills courses.