How can I define custom geometric mean evaluation metrics in tensorflow 2.0?

Viewed 45

How can implement the following imblearn geometric mean in Tensorflow to compile LSTM model?

from imblearn.metrics import geometric_mean_score
gmean = geometric_mean_score(yTest,yPred)

I wanted to use the following option, but it is not working like metrics=[keras.metrics.AUC(name='auc')]

from keras import backend 
def gmean(y_true, y_pred):
    return backend.geometric_mean_score(yTest,yPred)

I tried this Available StackOverflow suggestions , but it didn't work as well.

0 Answers
Related