- synchrones = computeSynchrones(medoids,
- getRefSeries, nb_ref_curves, nb_series_per_chunk, ncores_clust, verbose, parll)
- distances = computeWerDists(synchrones, ncores_clust, verbose, parll)
- #TODO: if PAM cannot take big.matrix in input, cast it before... (more than OK in RAM)
- medoids[ cluster::pam(distances, K2, diss=TRUE)$medoids , ]
+ if (verbose)
+ cat(paste("*** Clustering task 2 on ",ncol(medoids)," synchrones\n", sep=""))
+
+ if (ncol(medoids) <= K2)
+ return (medoids)
+
+ # A) Obtain synchrones, that is to say the cumulated power consumptions
+ # for each of the K1 initial groups
+ synchrones = computeSynchrones(medoids, getRefSeries, nb_ref_curves,
+ nb_series_per_chunk, ncores_clust, verbose, parll)
+
+ # B) Compute the WER distances (Wavelets Extended coefficient of deteRmination)
+ distances = computeWerDists(
+ synchrones, nvoice, nbytes, endian, ncores_clust, verbose, parll)
+
+ # C) Apply clustering algorithm 2 on the WER distances matrix
+ if (verbose)
+ cat(paste("*** algoClust2() on ",nrow(distances)," items\n", sep=""))
+ medoids[ ,algoClust2(distances,K2) ]