def accuracy(c):
    """ Compute accuracy given Numpy array confusion matrix C. Returns a floating point value. """
    n, _ = c.shape
    return sum([c[i, i] for i in range(n)]) / sum([c[i, j] for i in range(n) for j in range(n)])