How to compute Receiving Operating Characteristic (ROC) and AUC in keras?

前端 未结 8 1786
一生所求
一生所求 2020-11-28 02:07

I have a multi output(200) binary classification model which I wrote in keras.

In this model I want to add additional metrics such as ROC and AUC but to my knowledg

8条回答
  •  醉梦人生
    2020-11-28 02:50

    I solved my problem this way

    consider you have testing dataset x_test for features and y_test for its corresponding targets.

    first we predict targets from feature using our trained model

     y_pred = model.predict_proba(x_test)
    

    then from sklearn we import roc_auc_score function and then simple pass the original targets and predicted targets to the function.

     roc_auc_score(y_test, y_pred)
    

提交回复
热议问题