Equal Error Rate in Python

后端 未结 5 1838
离开以前
离开以前 2021-02-04 09:50

Could anybody tell me how could I compute Equal Error Rate(EER) from ROC Curve in python? In scikit-learn there is method to compute roc curve and auc but could not find the met

5条回答
  •  眼角桃花
    2021-02-04 10:39

    To estimate the Equal Error Rate EER you look for the point within the ROC that makes the TPR value equal to FPR value, that is, TPR-FPR=0. In other words you look for the minimum point of abs(TPR-FPR)

    1. First of all you need to estimate the ROC curve:

    fpr, tpr, threshold = roc_curve(y, y_pred, pos_label=1)

    1. To compute the EER in python you need only one line of code:

    EER = threshold(np.argmin(abs(tpr-fpr)))

提交回复
热议问题