require("cluster", quietly=TRUE)
algoClust1 <- function(contribs,K) cluster::pam(t(contribs),K,diss=FALSE)$id.med
- indices1 <- clusteringTask1(1:n, getContribs, K1, algoClust1, 140, verbose=TRUE, parll=FALSE)
+ indices1 <- clusteringTask1(1:n, getContribs, K1, algoClust1, 140, verbose=TRUE)
medoids_K1 <- getSeries(indices1)
expect_equal(dim(medoids_K1), c(L,K1))
# Perfect situation: all medoids "after stage 1" are ~good
algoClust2 <- function(dists,K) cluster::pam(dists,K,diss=TRUE)$id.med
indices2 <- clusteringTask2(1:K1, getSeries, K2, algoClust2, 210, 3, 4, 8, "little",
- verbose=TRUE, parll=FALSE)
+ verbose=TRUE)
medoids_K2 <- getSeries(indices2)
expect_equal(dim(medoids_K2), c(L,K2))
if (length(indices)>0) as.matrix(series[,indices]) else NULL
}
- synchrones <- computeSynchrones(cbind(s1,s2,s3),getSeries,n,100,verbose=TRUE,parll=FALSE)
+ synchrones <- computeSynchrones(cbind(s1,s2,s3),getSeries,n,100,verbose=TRUE)
expect_equal(dim(synchrones), c(L,K))
for (i in 1:K)
series <- cbind(serie, serie)
getSeries <- function(indices) as.matrix(series[,indices])
dists <- computeWerDists(1:2, getSeries, 50, 3, 4, nbytes, endian,
- verbose=TRUE, parll=FALSE)
+ verbose=TRUE)
expect_equal(dists, matrix(0.,nrow=2,ncol=2))
# On two constant series