Skip to contents

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

Usage

optimal_skm(
  x,
  k,
  num_seeds = 10,
  method = NULL,
  m = 1,
  weights = 1,
  control = list()
)

Arguments

x

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

k

Integer. Number of cluters to detect for skmeans.

num_seeds

Integer. Number of trials with random seeds

method

a character string specifying one of the built-in methods for computing spherical \(k\)-means partitions, or a function to be taken as a user-defined method, or NULL (default value). If a character string, its lower-cased version is matched against the lower-cased names of the available built-in methods using pmatch. See Details for available built-in methods and defaults.

m

a number not less than 1 controlling the softness of the partition (as the “fuzzification parameter” of the fuzzy \(c\)-means algorithm). The default value of 1 corresponds to hard partitions; values greater than one give partitions of increasing softness obtained from a generalized soft spherical \(k\)-means problem.

weights

a numeric vector of non-negative case weights. Recycled to the number of objects given by x if necessary.

control

a list of control parameters. See Details.

Value

Returns an object inheriting from classes skmeans and pclust (see ?skmeans) which gives the local optimal skmeans clustering result within several trials.