TP、FP、FN、TN
ACC、SP、SN、Precision、MCC、F1-score
代码实现
#include <math.h>
double TP = 0, TN = 0, FP = 0, FN = 0;
double SN = 0, SP = 0, MCC = 0, ACC = 0, Precision = 0;
//...
SN = TP / (TP + FN);
SP = TN / (TN + FP);
Precision = TP / (TP + FP);
ACC = (TP + TN) / (TP + TN + FN + FP);
MCC = (TP * TN - FP * FN) / sqrt((TP + FN) * (TP + FP) * (TN + FP) * (TN + FN));
F1 = (2*SN*Precision)/(SN + Precision);