Logistic Regression: What is the value for precision when recall (true positive rate) is 0? A quick overview of definitions before I get into the question:

*

*True Positive (TP): An actual positive that the model classified as positive


*False Positive (FP): An actual negative that the model classified as positive


*False Negative (FN): An actual positive that the model classified as negative


*Recall (True Positive Rate, TPR): $\frac{TP}{TP + FN}$


*Precision: $\frac{TP}{TP + FP}$


*Logistic Threshold: A probability above which a sample is classified as positive and below which is classified as negative. It is the grey line in the figure:



*Confusion Matrix: Summary of classification results


*Steps to generating Precision-Recall curve: 1.) Choose a threshold. 2.) Generate confusion matrix. 3.) Calculate the TPR and Precision from confusion matrix and plot the point


*Example of Precision-Recall curve:

We can see from this example that the precision is 1 when the recall is 0. I find this confusing...

My question:
Let's say we choose a threshold of 1. Thus, all the samples will be classified as negatives. Thus there will be no true positives, no false positives, and likely a bunch of false negatives.
The calculated recall (TPR) would be: $\frac{0}{0 + FN} = 0$
The calculated precision would be: $\frac{0}{0 + 0} = \frac{0}{0}$
So how come the precision-recall curves I see have precision = 1 when recall (TPR) = 0?

You can't divide by zero, so precision is undefined. It's a pathological case, so it doesn't return meaningful results.
