cal_confus {multiROC}R Documentation

Calculate confusion matrices

Description

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)

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.

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

References

https://en.wikipedia.org/wiki/Confusion_matrix

Examples

data(test_data)
true_vec <- test_data[, 1]
pred_vec <- test_data[, 5]
confus_res <- cal_confus(true_vec, pred_vec)

[Package multiROC version 1.1.1 Index]