01-SillyPutty: Running SillyPutty

SillyPutty-classR Documentation

Running SillyPutty

Description

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.

Usage

  SillyPutty(labels, dissim, maxIter = 1000, loopSize = 15, verbose = FALSE)

Arguments

labels

A numeric vector containing pre-computed cluster labels

dissim

An object of class dist; that is, a distance matrix.

maxIter

A numneric vetor of length one; the maximum number of individual steps, each of which reclassifies only one object

loopSize

How many steps to retain in momry to test if you have entered an infinite loop while rearranging objects.

verbose

A logical vector of length one; should you output a lot of information while running?

Details

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.

Value

The constructor function SillyPutty, returns an object of the SillyPutty class.

Slots

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.

Author(s)

Kevin R. Coombes krc@silicovore.com, Dwayne G. Tally dtally110@hotmail.com

References

Pending

Examples

data(eucdist)
set.seed(12)
hc  <- hclust(eucdist, "ward.D2")
clues <- cutree(hc, k = 5)
hcSilly <- SillyPutty(clues, eucdist)

SillyPutty documentation built on May 29, 2024, 4:46 a.m.