#NEWLINE# def transform2votes( output , n_classes ) : #NEWLINE# #INDENT# n_samples = output . shape [ 0 ] #NEWLINE# votes = np . zeros ( ( n_samples , output ) ) #NEWLINE# for i in range ( n_samples ) : #NEWLINE# #INDENT# idx = output [ i ] #NEWLINE# votes [ ( i , idx ) ] = 1 #NEWLINE# #UNINDENT# return votes . astype ( 'int' )