What does the parameter “seed” do in function Cluster_Medoids?
A-Pai opened this issue · comments
@A-Pai,
the seed parameter allows reproducibility of the results. For instance,
require(ClusterR)
data(dietary_survey_IBS)
dat = dietary_survey_IBS[, -ncol(dietary_survey_IBS)]
dat = center_scale(dat)
cm = Cluster_Medoids(dat, clusters = 3, distance_metric = 'euclidean', swap_phase = TRUE, seed = 1)
# str(cm)
cm1 = Cluster_Medoids(dat, clusters = 3, distance_metric = 'euclidean', swap_phase = TRUE, seed = 1)
# str(cm1)
cm2 = Cluster_Medoids(dat, clusters = 3, distance_metric = 'euclidean', swap_phase = TRUE, seed = 2)
# str(cm2)
identical(cm, cm1)
# TRUE
identical(cm, cm2)
# FALSE
The documentation also mentions seed: integer value for random number generator (RNG)