Closed ukemamaster closed 2 years ago
Usually, the threshold will be the value where we get the equal error rate.
@zabir-nabil yes, the threshold is the value where we get the equal error rate. See the output
in the above question.
My question is how to find it?
@zabir-nabil yes, the threshold is the value where we get the equal error rate. See the
output
in the above question. My question is how to find it?
You can refer to the following code
from sklearn import metrics fpr, tpr, thresholds = metrics.roc_curve(labels, scores, pos_label=1) # fnr = 1 - tpr idxE = np.nanargmin(np.absolute((fnr - fpr))) eer = max(fpr[idxE], fnr[idxE]) * 100 threshold = thresholds[idxE] # get the threshold here
Closing this issue as enough explanation has already been explained.
@joonson I compute the optimal threshold using:
Output is:
But i am not sure if this is correct way to do it. Can somebody confirm this?