#NEWLINE# def test_on_independant( self ) : #NEWLINE# #INDENT# p = np . random . dirichlet ( ( [ 3.0 ] * 10 ) ) #NEWLINE# p = np . vstack ( [ ( 0.2 * p ) , ( 0.8 * p ) ] ) #NEWLINE# self . assertAlmostEqual ( conditional_entropy ( p , axis = 0 ) , entropy ( p . sum ( axis = 0 ) ) ) #NEWLINE# self . assertAlmostEqual ( conditional_entropy ( self , axis = 1 ) , entropy ( p . sum ( axis = 1 ) ) )