二分类模型的评价指标
https://www.cnblogs.com/xiaoniu-666/p/10511694.html
参考tf的方法
1predictions = tf.argmax(predict, 1) 2 actuals = tf.argmax(real, 1) 3 4ones_like_actuals = tf.ones_like(actuals) 5 zeros_like_actuals = tf.zeros_like(actuals) 6 ones_like_predictions = tf.ones_like(predictions) 7 zeros_like_predictions = tf.zeros_like(predictions) 8 9Lable: 1 1 0 0 10 predi: 1 0 0 1 11 Tp Fp Tn Fn 12 tp: = and 1 13 tn = ont(or) 1 14 15 lab-pred: 0 1 0 -1 16 17 lab-pred>=0.6: 0 1 0 0 18 fp = and(lable, lab-pred): 19 0 1 0 1 20 21 lab-pred<=-1.0: 0 0 0 1 22 not-lable: 0 0 1 1 23 fn = and(not-lable, lab-pred<-1.0) 24 25可能用到的方法: 26 27tf.less_equal 28tf.less 29tf.greater_equal 30tf.greatercount_nonzero
参考:
https://blog.csdn.net/sinat\_35821976/article/details/81334181
https://tensorflow.google.cn/api\_docs/python/tf/math/count\_nonzero