def accuracy(current, predicted):
 accuracy = 0
 if (np.count_nonzero(predicted) > 0):
  accuracy = (float(np.dot(current, predicted)) / float(np.count_nonzero(predicted)))
 return accuracy

def accuracy ( current , predicted ) : accuracy = 0 if ( np . count_nonzero ( predicted ) > 0 ) : accuracy = ( float ( np . dot ( current , predicted ) ) / float ( np . count_nonzero ( predicted ) ) ) return accuracy
given a list of reference values and a corresponding list of test values .