Learn R Programming

diceR (version 0.6.0)

external_validity: External validity indices

Description

External validity indices compare a predicted clustering result with a reference class or gold standard.

Usage

ev_nmi(pred.lab, ref.lab, method = "emp")

ev_confmat(pred.lab, ref.lab)

Arguments

pred.lab

predicted labels generated by classifier

ref.lab

reference labels for the observations

method

method of computing the entropy. Can be any one of "emp", "mm", "shrink", or "sg".

Value

ev_nmi returns the normalized mutual information.

ev_confmat returns a vector of the following metrics: overall accuracy, Cohen's kappa, no information rate, accuracy p-value. Statistics are difficult to compare when there are multiclass comparisons. We hence also report averaged statistics for: sensitivity, specificity, PPV, NPV, prevalence, detection rate, detection prevalence, accuracy, and balanced accuracy.

Details

ev_nmi calculates the normalized mutual information

ev_confmat calculates a variety of statistics associated with confusion matrices.

References

Strehl A, Ghosh J. Cluster ensembles: a knowledge reuse framework for combining multiple partitions. J. Mach. Learn. Res. 2002;3:583-617.

Examples

Run this code
# NOT RUN {
suppressWarnings(RNGversion("3.5.0"))
set.seed(1)
E <- matrix(rep(sample(1:4, 1000, replace = TRUE)), nrow = 100, byrow =
              FALSE)
x <- sample(1:4, 100, replace = TRUE)
y <- sample(1:4, 100, replace = TRUE)
ev_nmi(x, y)
ev_confmat(x, y)
# }

Run the code above in your browser using DataLab