#' @param WER "end" to apply stage 2 after stage 1 has iterated and finished, or "mix"
#' to apply it after every stage 1
#' @param ncores number of parallel processes; if NULL, use parallel::detectCores()
#'
#' @return A data.frame of the final medoids curves (identifiers + values)
epclust = function(data, K, nb_series_per_chunk, min_series_per_chunk=10*K,
#' @param WER "end" to apply stage 2 after stage 1 has iterated and finished, or "mix"
#' to apply it after every stage 1
#' @param ncores number of parallel processes; if NULL, use parallel::detectCores()
#'
#' @return A data.frame of the final medoids curves (identifiers + values)
epclust = function(data, K, nb_series_per_chunk, min_series_per_chunk=10*K,