Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

keras auc without tf.metrics.auc

import tensorflow as tf
from sklearn.metrics import roc_auc_score

def auroc(y_true, y_pred):
    return tf.py_func(roc_auc_score, (y_true, y_pred), tf.double)

# Build Model...

model.compile(loss='categorical_crossentropy', optimizer='adam',metrics=['accuracy', auroc])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #keras #auc
ADD COMMENT
Topic
Name
6+1 =