powered by
Relabel clustering categories to match to a standard by minimizing the Frobenius norm between the two labels.
relabel_class(pred.cl, ref.cl)
A vector of relabeled cluster assignments
vector of predicted cluster assignments
vector of reference labels to match to
Aline Talhouk
set.seed(2) pred <- sample(1:4, 100, replace = TRUE) true <- sample(1:4, 100, replace = TRUE) relabel_class(pred, true)
Run the code above in your browser using DataLab