def sensitivity(p, t):
    '''
    Fraction of negative samples correctly identified as negative.
    :param p: Multi-dimensional numpy array with the predicted values.
    :param t: Multi-dimensional numpy array with the known values.
    :return: Float value between 0 and 1.
    '''

    # Calculates number of correctly identified negative samples.
    num = sum([1 for i, j in zip(np.argmax(p, axis=1), np.argmax(t, axis=1)) if i == 1 and j == 1])

    # Calculates total number of negative samples.
    denom = sum([1 for i in np.argmax(t, axis=1) if i == 1])

    return num / float(denom)
dataset/ETHPy150Open calvinschmdt/EasyTensorflow/easy_tensorflow/evolve_functions.py/sensitivity/original