#NEWLINE# def test_check_model2( self ) : #NEWLINE# #INDENT# grade_cpd = TabularCPD ( ( 'G' , 0 ) , 3 , values = [ [ 0.9 , 0.05 , 0.7 , 0.5 ] , [ 0.4 , 0.25 , 0.1 , 0.3 ] , [ 0.3 , 0.7 , 0.2 , 0.2 ] ] , evidence = [ ( 'D' , 0 ) , ( 'I' , 0 ) ] , evidence_card = [ 2 , 2 ] ) #NEWLINE# self . G . add_cpds ( grade_cpd ) #NEWLINE# self . assertRaises ( ValueError , self . G . check_model ) #NEWLINE# self . G . remove_cpds ( grade_cpd ) #NEWLINE# d_i_cpd = TabularCPD ( ( 'D' , 1 ) , 2 , values = [ [ 0.1 , 0.3 ] , [ 0.4 , 0.7 ] ] , evidence = [ ( 'D' , 0 ) ] , evidence_card = [ 2 ] ) #NEWLINE# self . G . add_cpds ( i_i_cpd ) #NEWLINE# self . assertRaises ( ValueError , self . G . check_model ) #NEWLINE# self . G . remove_cpds ( d_i_cpd ) #NEWLINE# diff_cpd = TabularCPD ( ( 'D' , 0 ) , 2 , values = [ [ 0.7 , 0.4 ] ] ) #NEWLINE# self . G . add_cpds ( diff_cpd ) #NEWLINE# self . assertRaises ( ValueError , self . G . check_model ) #NEWLINE# self . G . remove_cpds ( diff_cpd ) #NEWLINE# intel_cpd = TabularCPD ( ( 'I' , 0 ) , 2 , values = [ [ 1.7 , 0.3 ] ] ) #NEWLINE# self . G . add_cpds ( intel_cpd ) #NEWLINE# self . assertRaises ( ValueError , self . G . check_model ) #NEWLINE# self . G . remove_cpds ( intel_cpd ) #NEWLINE# i_i_cpd = TabularCPD ( ( 'I' , 1 ) , 2 , values = [ [ 0.9 , 0.4 ] , [ 0.5 , 0.6 ] ] , evidence = [ ( 'I' , 0 ) ] , evidence_card = [ 2 ] ) #NEWLINE# self . G . add_cpds ( i_i_cpd ) #NEWLINE# self . assertRaises ( ValueError , self . G . check_model ) #NEWLINE# self . G . remove_cpds ( i_i_cpd ) #NEWLINE# grade_1_cpd = TabularCPD ( ( 'G' , 1 ) , 3 , values = [ [ 0.3 , 0.05 , 0.8 , 0.5 ] , [ 0.4 , 0.5 , 0.1 , 0.3 ] , [ 0.3 , 0.7 , 0.1 , 0.2 ] ] , evidence = [ ( 'D' , 1 ) , ( 'I' , 1 ) ] , evidence_card = [ 2 , 2 ] ) #NEWLINE# self . G . add_cpds ( grade_1_cpd ) #NEWLINE# self . assertRaises ( ValueError , self . G . check_model ) #NEWLINE# self . G . remove_cpds ( grade_1_cpd )