powered by
Calculate Matthews correlation coefficient
mcc(preds = NULL, actuals = NULL, TP = NULL, FP = NULL, TN = NULL, FN = NULL)
A vector of prediction values in 1, 0, or TRUE, FALSE
A vector of actuals values in 1, 0, or TRUE, FALSE
Count of true positives (correctly predicted 1/TRUE)
Count of false positives (predicted 1/TRUE, but actually 0/FALSE)
Count of true negatives (correctly predicted 0/FALSE)
Count of false negatives (predicted 0/FALSE, but actually 1/TRUE)
Calculate Matthews correlation coefficient. Either
preds and actuals can be given, leaving TP, FP, TN, and FN NULL or
preds
actuals
TP
FP
TN
FN
TP, FP, TN, and FN can be given, leaving preds and actuals NULL
https://en.wikipedia.org/wiki/Matthews_correlation_coefficient
# NOT RUN { preds <- c(1,1,1,0,1,1,0,0) actuals <- c(1,1,1,1,0,0,0,0) mcc(preds, actuals) mcc(actuals, actuals) mcc(TP=3, FP=2, TN=2, FN=1) # }
Run the code above in your browser using DataLab