#NEWLINE# def predict( self , data , ilog = None ) : #NEWLINE# #INDENT# if isinstance ( data , pv . Image ) : #NEWLINE# #INDENT# data = data . asMatrix2D ( ) . flatten ( ) #NEWLINE# #UNINDENT# data = array ( data , 'd' ) . flatten ( ) #NEWLINE# data = self . normalizeVector ( data ) #NEWLINE# value = self . predictValue ( self , ilog = ilog ) #NEWLINE# if ( ( self . type == TYPE_TWOCLASS ) or ( self . type == TYPE_MULTICLASS ) ) : #NEWLINE# #INDENT# return self . invertClass ( value ) #NEWLINE# #UNINDENT# if ( self . type == TYPE_REGRESSION ) : #NEWLINE# #INDENT# return self . invertReg ( value )