# Question

Does the AUC metric calculates the area of ROC or PR?

# Background

tf.keras.metrics.AUC says:

This value is ultimately returned as auc, an idempotent operation that computes the area under a discretized curve of precision versus recall values (computed using the aforementioned variables).

Therefore, it should be calculating the area under PR, not ROC. However, it also says:

Approximates the AUC (Area under the curve) of the ROC or PR curves

If it calculate the area under PR, then why it says "Approximate ROC or PR" instead of clearly saying "Approximate PR" only without ROC?

As defined in the Keras documentation: "Approximates the AUC (Area under the curve) of the ROC or PR curves", it gives you the option to get the Area Under the Curve for both ROC curve or Precission-Recall curve (specially useful for highly unbalanced datasets). The choice of your desired curve can be done vía the 'curve' parameter below:

tf.keras.metrics.AUC(
num_thresholds=200, curve='ROC',
summation_method='interpolation', name=None, dtype=None,
thresholds=None, multi_label=False, num_labels=None, label_weights=None,
from_logits=False
)

• Thanks for the reply. So this description "This value is ultimately returned as auc, an idempotent operation that computes the area under a discretized curve of precision versus recall values" should be wrong as it is limiting to PR only?
– mon
Jul 17, 2021 at 11:44
• As far as I can see in the description of the current documentation, and as I also used it several times, it gives you the chance to select the curve type you want, being ROC the default one Jul 17, 2021 at 13:07
• num_thresholds  is the threshold that would be the predicted probability of an observation belonging to the positive class. So for binary classification (which is logistic regression) it would be say >0.5. So what value do we use here? What about the summation_method ? Or maybe I'm going about this the wrong way. I just want to access the AUC value that's in the classification report output. Jul 11, 2022 at 14:10