emba (version 0.1.1)

calculate_mcc: Calculate the Matthews correlation coefficient vector

Description

Use this function to calculate the MCC values given vectors of TP (true positives), FP (false positives), TN (true negatives), FN (false negatives), P (positives) and N (negatives). Note that the input vectors have to be of the same size and have one-to-one value correspondence for the output MCC vector values to make sense.

Usage

calculate_mcc(tp, tn, fp, fn, p, n)

Arguments

tp

numeric vector of TPs

tn

numeric vector of TNs

fp

numeric vector of FPs

fn

numeric vector of FNs

p

numeric vector of positives (p = tp + fn)

n

numeric vector of negatives (n = tn + fp)

Value

a numeric vector of MCC values, each value being in the [-1,1] interval or NaN.

See Also

Other confusion matrix calculation functions: calculate_models_mcc, calculate_models_synergies_fn, calculate_models_synergies_fp, calculate_models_synergies_tn, calculate_models_synergies_tp