How should I determine what seed to use while using "flexclust" package? I am trying to find a clustering solution with the help of flexclust package in R. The following code has been adapted from the vignette for the flexclust package:
library(flexclust)
library(ISLR)

Auto <- read.table(Auto)
AutoMinus <- Auto[ -c(8:9)]
AutoMinus.mat <- as.matrix(AutoMinus)

# Setting the parameters

fc_cont <- new("flexclustControl")  
fc_cont@tolerance <- 0.01   
fc_cont@iter.max <- 25
fc_cont@verbose <- 1
fc_family <- "kmeans"             

seed1 <- 12345
fc_seed <- seed1
num_clusters <- 3
set.seed(fc_seed)

AutoMinus.cl <- kcca(AutoMinus.mat, k = num_clusters, save.data = TRUE, control = fc_cont, family = kccaFamily(fc_family))
summary(AutoMinus.cl)

cluster info:
  size  av_dist max_dist separation
1  122 263.0698 525.3528   480.3347
2  180 217.1523 610.9503   478.7658
3   90 290.9777 905.5731   551.2422

Every time I change the seed, the output changes. I am evaluating different outputs based on lowest av_dist, lowest max_dist and minimum separation. My understanding is separation is within a given cluster. I tried to find the definition of separation in the documentation, but couldn't find it. My questions are:


*

*How do I set the seed that will give me the best/optimal(?) solution?

*Are there any general good practices for initializing a seed value?

*Is my understanding of separation correct?


Thank you!
 A: Don't optimize the seed
It's okay to loop over seeds 1 to 10 and use an (unsupervised!) internal measure to choose the "best".
But messing around with the seed to get the best result is overfittting. You cannot do this on real data.
If the seed is important, then the algorithm failed
If the results vary a lot, this shows they are not stable, but random. If the method doesn't reliably produce a good result, consider the results to be "not better than random".
A: You are correct in saying that setting the seed is good for creating reproducible results. This is often useful for code debugging or for HW assignments where the teacher wants to make it easier to grade the assignment. However there is no way to 'optimally' set the seed. All setting the seed does is give the random number generator (RNG) a place to start. However the RNG is programmed to avoid 'non-random' output. By choosing a specific seed (or set of seeds) you can create bias in your results. My advice would be to let the random number generator do it's job.
In this case the random numbers are being accessed in  the kcca() function when it chooses an k initial starting center points for the k-means algorithm. By setting the seed you are essentially telling the k-means algorithm to use the same starting centers each times it runs. The k-means algorithm itself is not-guaranteed to converge to the global optimum so different starting points for the algorithm can lead to different results. 
