#NEWLINE# def addTraining( self , label , data , ilog = None ) : #NEWLINE# #INDENT# if ( ilog . type == TYPE_REGRESSION ) : #NEWLINE# #INDENT# self . labels . append ( float ( label ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . labels . append ( label ) #NEWLINE# #UNINDENT# if isinstance ( data , pv . Image ) : #NEWLINE# #INDENT# data = data . asMatrix2D ( ) . flatten ( ) #NEWLINE# #UNINDENT# data = array ( data , 'd' ) . flatten ( ) #NEWLINE# self . vectors . append ( data )