Skip to contents

This function will select the optimal clustering result from several kmeans runs with different random seeds, The clustering result with the smallest within-cluster-sum of squared distances will be selected.

Usage

optimal_km(x, k, num_seeds = 10, iter_max = 10, ...)

Arguments

x

Matrix. This function will cluster the rows of the input matrix.

k

Integer. Number of cluters to detect for kmeans.

num_seeds

Integer. Number of trials with random seeds

iter_max

Integer. Number of iterations.

...

Further arguments handed to stats::kmeans

Value

Returns an object of class "kmeans" with is a list with several components (see ?kmeans) which guves the local optimal kmeans clustering result within #num_seeds trials.