if (length(indices)>0) series[,indices] else NULL
}
synchrones = computeSynchrones(bigmemory::as.big.matrix(cbind(s1,s2,s3)), getRefSeries,
- n, 100, sync_mean=TRUE, verbose=TRUE, parll=FALSE)
+ n, 100, verbose=TRUE, parll=FALSE)
expect_equal(dim(synchrones), c(L,K))
for (i in 1:K)
- expect_equal(synchrones[,i], s[[i]], tolerance=0.01)
+ expect_equal(synchrones[,i]/100, s[[i]], tolerance=0.01)
})
# Helper function to divide indices into balanced sets
medoids_K1 = bigmemory::as.big.matrix( sapply( 1:K1, function(i) s[[I(i,K1)]] ) )
algoClust2 = function(dists,K) cluster::pam(dists,K,diss=TRUE)$id.med
medoids_K2 = clusteringTask2(medoids_K1, K2, algoClust2, getRefSeries,
- n, 75, sync_mean=TRUE, verbose=TRUE, parll=FALSE)
+ n, 75, verbose=TRUE, parll=FALSE)
expect_equal(dim(medoids_K2), c(L,K2))
# Not easy to evaluate result: at least we expect it to be better than random selection of