Clarification on tf.keras.metrics.AUC

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?

Please help understand what I am missing.

Topic auc keras tensorflow

Category Data Science


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
)

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.