This function calculates the confusion matrices across different cutoff points.
Usage
cal_confus(true_vec, pred_vec, force_diag=TRUE)
Arguments
true_vec
A binary vector of real labels
pred_vec
A continuous predicted score(probabilities) vector, must be the same length with true_vec
force_diag
If TRUE, TPR and FPR will be forced to across (0, 0) and (1, 1)
Value
TP
True positive
FP
False positive
FN
False negative
TN
True negative
TPR
True positive rate
FPR
False positive rate
PPV
Positive predictive value
Details
This function calculates the TP, FP, FN, TN, TPR, FPR and PPV across different cutoff points of pred_vec. TPR and FPR are forced to across (0, 0) and (1, 1) if force_diag=TRUE.