def percentError(out, true):
 arrout = array(out).flatten()
 wrong = where((arrout != array(true).flatten()))[0].size
 return ((100.0 * float(wrong)) / float(arrout.size))

def percentError ( out , true ) : arrout = array ( out ) . flatten ( ) wrong = where ( ( arrout != array ( true ) . flatten ( ) ) ) [ 0 ] . size return ( ( 100.0 * float ( wrong ) ) / float ( arrout . size ) )
return percentage of mismatch between out and target values .