A function that takes in an already existing starting location based on unsupervised clustering attempts. I.G. Kmeans or Hieriarchical cluster assignment. SillyPutty optimizes the pre-exisitng cluster assignments based on the best silhouette width score.
SillyPutty(labels, dissim, maxIter = 1000, loopSize = 15, verbose = FALSE)The constructor function SillyPutty, returns an object of
the SillyPutty class.
A numeric vector containing pre-computed cluster labels
An object of class dist; that is, a distance matrix.
A numneric vetor of length one; the maximum number of individual steps, each of which reclassifies only one object
How many steps to retain in momry to test if you have entered an infinite loop while rearranging objects.
A logical vector of length one; should you output a lot of information while running?
cluster:A list containing the adjusted cluster assignment that had the best silhouette width.
silhouette:A dataframe containing the silhouette width scores.
minSW:A silhouette double vector that contains the positive and negative version of the minimum silhouette width value.
meanSW:A double vector that contains the average silhouette width value.
Kevin R. Coombes krc@silicovore.com, Dwayne G. Tally dtally110@hotmail.com
The SillyPutty function processes a pre-computed cluster assignment
along with a distance metric and returns a s4 object. The cluster
component is a list of the new cluster assignments based on best
silhouette width score. The silhouette is a dataframe containing the
silhouette width score calculated by SillyPutty. The minSw contains
a positive and negative version of the minimum silhouette width score.
The meanSW is a double vector that shows the average silhouette width
score after applying SillyPutty to the cluster assignment.
Pending
data(eucdist)
set.seed(12)
hc <- hclust(eucdist, "ward.D2")
clues <- cutree(hc, k = 5)
hcSilly <- SillyPutty(clues, eucdist)
Run the code above in your browser using DataLab