Reciever Operator Characteristic
    :param clss: known classes. 1 if positive case, -1 if the negative case
    :type class: list of boolean
    :param vals: classification probabilites etc...
    :type vals: list of real numbers
    :param bool reverse: whether the values should be sorted in reverse order

def roc(clss, vals, reverse=False):
    """ Reciever Operator Characteristic
    :param clss: known classes. 1 if positive case, -1 if the negative case
    :type class: list of boolean
    :param vals: classification probabilites etc...
    :type vals: list of real numbers
    :param bool reverse: whether the values should be sorted in reverse order
    """
    assert len(clss) == len(vals)
    global X, Y, A, T, M, B
    
    order = numpy.argsort(vals)
    if reverse:
        order = order[::-1]
    clss = numpy.array(clss)[order]
    vals = numpy.array(vals)[order]
    
    length = len(clss) + 1
    data = numpy.empty((length, 6), dtype=numpy.float32)
    data[0, X], data[0, Y], data[0, A] = 0
    data[0, T] = vals[0]
    
    for i in range(length-1):
        if clss[i] == 1:
            data[i+1, X] = data[i, X]
            data[i+1, Y] = data[i, Y] + 1
            data[i+1, A] = data[i, A]
        else:
            data[i+1, X] = data[i, X] + 1
            data[i+1, Y] = data[i, Y]
            data[i+1, A] = data[i, A] + data[i+1, Y]
        
        data[i+1, T] = vals[i]
    
    # Incorporate accuracy scores
    data[0, M] = 0
    for i in range(1, length-1):
        fp = data[i, X]
        tp = data[i, Y]
        tn = data[-1, X] - fp
        fn = data[-1, Y] - tp
        data[i, M] = mcc(tp, tn, fp, fn)
        data[i, B] = ber(tp, tn, fp, fn)
    data[-1, M] = 0
    return data