R/calculate_performance.R
calculate_performance.Rd
Performance measures for two-class classification
calculate_performance(truth, prediction, pos_label = levels(truth)[2])
truth | ( |
---|---|
prediction | A vector with predicted classes. |
pos_label | ( |
A matrix with the following columns:
tp
(number of true positives),
fn
(number of false negatives),
fp
(number of false positives),
tn
(number of true negatives),
sens
(sensitivity),
spec
(specificity),
ppv
(positive predictive value),
npv
(negative predictive value),
youden
(Youden's j index),
kappa
(Cohen's kappa).
attribute labels
contains a named vector with elements
pos_label
and neg_label
, which indicate labels of
positive and negative groups respectively.
Other functions for ROC:
access_elements
,
print.as_str()
,
roc_performance_measures
,
roc_predict()
Vilmantas Gegzna
#> [1] H H H S S S H H H S S S H H H S S S H H #> Levels: H S#> [1] H H S S S H H H S S S H H H S S S H H H #> Levels: H Scalculate_performance(truth, prediction)#> tp fn fp tn sens spec ppv npv bac youden kappa #> 1 6 3 3 8 0.67 0.73 0.67 0.73 0.70 0.39 0.39calculate_performance(truth, prediction, pos_label = "S")#> tp fn fp tn sens spec ppv npv bac youden kappa #> 1 6 3 3 8 0.67 0.73 0.67 0.73 0.70 0.39 0.39calculate_performance(truth, prediction, pos_label = "H")#> tp fn fp tn sens spec ppv npv bac youden kappa #> 1 8 3 3 6 0.73 0.67 0.73 0.67 0.70 0.39 0.39