def ComputeErrorRate(error_count, truth_count):
 if (truth_count == 0):
  truth_count = 1
  error_count = 1
 elif (error_count > truth_count):
  error_count = truth_count
 return ((error_count * 100.0) / truth_count)

def ComputeErrorRate ( error_count , truth_count ) : if ( truth_count == 0 ) : truth_count = 1 error_count = 1 elif ( error_count > truth_count ) : error_count = truth_count return ( ( error_count * 100.0 ) / truth_count )
returns a sanitized percent error rate from the raw counts .