data(SupremeCourt)
d_supreme <- as.dist(SupremeCourt)
# find best seriation order (tries by by default several fast methods)
o <- seriate_best(d_supreme, criterion = "AR_events")
o
pimage(d_supreme, o)
# run a randomized algorithms several times. It automatically chooses the
# LS criterion. Repetition information is returned as attributes
o <- seriate_rep(d_supreme, "QAP_LS", rep = 5)
attr(o, "criterion")
hist(attr(o, "criterion_distribution"))
pimage(d_supreme, o)
if (FALSE) {
# Using parallel execution on a larger dataset
data(iris)
m_iris <- as.matrix(iris[sample(seq(nrow(iris))),-5])
d_iris <- dist(m_iris)
library(doParallel)
registerDoParallel(cores = detectCores() - 1L)
# seriate rows of the iris data set
o <- seriate_best(d_iris, criterion = "LS")
o
pimage(d_iris, o)
# improve the order to minimize RGAR instead of LS
o_improved <- seriate_improve(d_iris, o, criterion = "RGAR")
pimage(d_iris, o_improved)
# available control parameters for seriate_improve()
get_seriation_method(name = "GSA")
}
Run the code above in your browser using DataLab