title: Does tf.keras.metrics.AUC work on multi-class problems?
body: <p>I have a multi-class classification problem and I want to measure AUC on training and test data.</p>
  <p>tf.keras has implemented AUC metric (tf.keras.metrics.AUC), but I'm not be able to see whether this metric could safely be used in multi-class problems. Even, the example &quot;Classification on imbalanced data&quot; on the official Web page is dedicated to a binary classification problem.</p>
  <p>I have implemented a CNN model that predicts six classes, having a softmax layer that gives the probabilities of all the classes. I used this metric as follows</p>
  <pre><code>self.model.compile(loss='categorical_crossentropy',
                         optimizer=Adam(hp.get(&quot;learning_rate&quot;)),
                         metrics=['accuracy', AUC()]),
  </code></pre>
  <p>and the code was executed without any problem. However, sometimes I see some results that are quite strange for me. For example, the model reported an accuracy of 0.78333336 and AUC equal to 0.97327775, Is this possible? Can a model have a low accuracy and an AUC so high?</p>
  <p>I wonder that, although the code does not give any error, the AUC metric is computing wrong.</p>
  <p>Somebody may confirm me whether or not this metrics support multi-class classification problems?</p>