AUC for multi-class classification


Does tf.keras.metrics.AUC work for sparse multi-class classification or do I need to transform labels into one-hot representation?


Maybe @markdaoust can help

A quick experiment and scan of the code says no.

y_true goes straight here:

It’s easy to write a wrapper to do the one-hot.

If you’re motivated to make this work you could always ask on the keras repo if they’d accept a “sparse” Argument to the constructor (or code to do the one-hot if passed an int).


Thanks @markdaoust & @lgusm. I will check the code.
Meanwhile I had transformed everything into non-sparse but your point of view of adding a wrapper is better I guess.

1 Like