def __get_accuracy(predictor, test_set, evaluate):
    """Calculates the accuracy of a given classification predictor using
    the given test set.
    :param predictor: Predictor to test.
    :param test_set: Test set to use for testing.
    :param evaluate: Function that is used to evaluate the predictor.
    Should take as arguments the predictor to evaluate and the input
    and returns corresponding prediction.
    :return: Measured accuracy of the predictor."""
    correct_count = 0
    for point in test_set:
        input = point[0:-1]
        output = point[-1]
        prediction = evaluate(predictor, input)
        if prediction == output:
            correct_count += 1
    return correct_count/len(test_set)