#How to find the tpr and fpr

2 messages · Page 1 of 1 (latest)

tender pelican
#

I have an xgboost model and I am trying to find that value of threshold that maximizes the product of TPR and (1-FPR)


fpr, tpr, threshold = sklearn.metrics.roc_curve(y_test, y_pred[:,0])

fpr_tpr = np.multiply((1-fpr), tpr)
max = np.argmax(fpr_tpr)

print(fpr[max])
print(tpr[max])

I have attached my ROC curve. According to the calculation of fpr and tpr above, I get
fpr = 0.5
tpr = 0.1

Somehow this does not look right to me, having tpr value so low.

Can you please let me know what is wrong?

amber remnant