如何在python中找到并计算相等错误率?

时间:2018-11-02 04:38:28

标签: python machine-learning scikit-learn

我在计算二进制类问题之间的相等错误率时遇到问题。我读到有关EER的信息,并且总是一样的(FAR和FFR相同时的EER),但是当我找不到给我EER的阈值时该怎么办?

我正在做什么:

    prediction_probability = clf.predict_proba(test_set)
    eer = 0
    for threshold in prediction_probability:
        prediction = __prediction_list(threshold[1], prediction_probability) #Return a list with the class 1 or 0
        frr, far_skilled, far_random = __classification_metrics(prediction, number_of_genuine, number_of_skilled, number_of_random)
        eer, best_eer = equal_error_rate_with_verification(far_skilled, frr, eer)
        if best_eer:
            break

equal_error_rate_with_verification方法是这样的:

def equal_error_rate_with_verification(far_skilled, frr, eer_old):
if(far_skilled == frr):
        return (frr, True)
else:
        diff = abs(far_skilled - frr)
        if eer_old > diff:
            return (diff, False)

该实现是我从How to compute & plot Equal Error Rate (EER) from FAR/FRR values using matlab获得的 我正在使用SVM分类器,但是我是该领域的新手,那么如何计算EER或找到它呢?

0 个答案:

没有答案