For a sample of clusterings in which corresponding clusters have different labels the algorithm attempts to bring the clusterings to a unique labelling.
relabel(cls, print.loss = TRUE)
a matrix in which every row corresponds to a clustering of the ncol(cls)
objects.
logical, should current value of loss function be printed after each iteration? Defaults to TRUE.
the input cls
with unified labelling.
an
value of the loss function.
vector of cluster memberships that have the highest probabilities
The algorithm assumes that the number of clusters
The algorithm minimizes the loss function
Minimization is achieved by iterating the estimation of
Stephens, M. (2000) Dealing with label switching in mixture models. Journal of the Royal Statistical Society Series B, 62, 795--809.
lp.transport
for the linear programming, maxpear
, minbinder
, medv
for other possibilities of processing a sample of clusterings.
# NOT RUN {
(cls <- rbind(c(1,1,2,2),c(1,1,2,2),c(1,2,2,2),c(2,2,1,1)))
# group 2 in clustering 4 corresponds to group 1 in clustering 1-3.
cls.relab <- relabel(cls)
cls.relab$cls
# }
Run the code above in your browser using DataLab