Skip to content

Instantly share code, notes, and snippets.

@easadler
Created April 3, 2019 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save easadler/0a55e5bfe3ac394b2b4fbdb9c5968c5d to your computer and use it in GitHub Desktop.
Save easadler/0a55e5bfe3ac394b2b4fbdb9c5968c5d to your computer and use it in GitHub Desktop.
Macro-average example with tf.metrics
import tensorflow as tf
aucs = [tf.metrics.auc(labels[:, i], probabilities[:, i], weights=weights[:, i])
for i in range(tasks)]
macro_auc = tf.metrics.mean([m[1] for m in aucs],
name='macro_auc')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment