#NEWLINE# def new_entropy( ensemble , X , y ) : #NEWLINE# #INDENT# out = ensemble . output ( X ) #NEWLINE# P = ( np . sum ( out , axis = 2 ) / out . shape [ 1 ] ) #NEWLINE# P = ( ( - P ) * np . log ( ( P + 1e-07 ) ) ) #NEWLINE# entropy = np . mean ( np . sum ( P , axis = 1 ) ) #NEWLINE# return entropy