1
$\begingroup$

I was trying to manually calculate $\text{TPR}$ and $\text{FPR}$ for the given data. But unfortunately I dont have any false positive cases in my dataset and even no true positive cases. So I am getting divided by zero error in pandas. So I have an intuition that $\text{FPR=1-TPR}$. Please let me know my intuition is correct if not let know how to fix this issue.

$\endgroup$

2 Answers 2

0
$\begingroup$

If there are no true/false positives, your classifier has no positive labelings. FPR is simply $\frac{FP}{N}$, where $N$ is number of negatives in the dataset. Assuming there are negative cases in the data, FPR is $0$. TPR is actually $1-\text{FNR}$ (false negative rate), and that is $TP \over P$. Since you have $\text{TP}=0$, and assuming there are positive samples in the dataset, $\text{TPR}$ is also $0$.

$\endgroup$
0
$\begingroup$

The TPR is defined as $\frac{TP}{P}$ (see, e.g. Wikipedia) or Encyclopedia of Systems Biology which says it is

"In machine learning, the true positive rate, also referred to sensitivity or recall, is used to measure the percentage of actual positives which are correctly identified."

or other sources.

So, when there are no positive cases, I would say that the TPR is undefined.

But your question is a little ambiguous, see the other answer, which reads your question differently.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.