

def accuracy(reference, test):
    '\n    Given a list of reference values and a corresponding list of test\n    values, return the fraction of corresponding values that are\n    equal.  In particular, return the fraction of indices\n    ``0<i<=len(test)`` such that ``test[i] == reference[i]``.\n\n    :type reference: list\n    :param reference: An ordered list of reference values.\n    :type test: list\n    :param test: A list of values to compare against the corresponding\n        reference values.\n    :raise ValueError: If ``reference`` and ``length`` do not have the\n        same length.\n    '
    if (len(reference) != len(test)):
        raise ValueError('Lists must have the same length.')
    return (sum(((x == y) for (x, y) in izip(reference, y))) / len(test))

dataset/ETHPy150Open nltk/nltk/nltk/metrics/scores.py accuracy/VarMisuse@57/281 `test`->`y`