<s> import numpy as np <EOL> from pomegranate import * <EOL> passenger = DiscreteDistribution ( { '<STR_LIT:w>' : <NUM_LIT:0.5> , '<STR_LIT>' : <NUM_LIT:0.5> } ) <EOL> gender = ConditionalProbabilityTable ( <EOL> [ [ '<STR_LIT:w>' , '<STR_LIT:w>' , <NUM_LIT:1> ] , <EOL> [ '<STR_LIT>' , '<STR_LIT:w>' , <NUM_LIT:0> ] , <EOL> [ '<STR_LIT:w>' , '<STR_LIT>' , <NUM_LIT:0> ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT:1> ] ] , [ hardware ] ) <EOL> s1 = State ( passenger , name = "<STR_LIT>" ) <EOL> s2 = State ( gender , name = "<STR_LIT>" ) <EOL> network = BayesianNetwork ( "<STR_LIT>" ) <EOL> network . add_nodes ( [ s1 , s2 ] ) <EOL> network . add_edge ( s1 , s2 ) <EOL> network . add_edge ( s1 , s3 ) <EOL> network . bake ( ) </s>
