02-RandomSillyPutty: Running SillyPutty From Multiple Random Initial Clusterings

RandomSillyPutty-classR Documentation

Running SillyPutty From Multiple Random Initial Clusterings

Description

A function to perform cluster assignments on a distance matrix based on optimizing silhouette width. The cluster assignments are based on maximum and minimum silhouette width scores obtained from N iterations.

Usage

RandomSillyPutty(distobj, K, N = 100, verbose = FALSE, ...)
## S4 method for signature 'RandomSillyPutty,matrix'
plot(x, y, distobj, col = NULL, ...)
## S4 method for signature 'RandomSillyPutty,missing'
plot(x, y, ...)
## S4 method for signature 'RandomSillyPutty'
summary(object, ...)
## S4 method for signature 'RSPSummary,missing'
plot(x, y, ...)

Arguments

distobj

An object of class dist.

K

The number of clusters.

N

The number of iterations you want to run.

verbose

A logical value; should you print info while working

...

Extra arguments to the SillyPutty function or to generic methods.

x

An object of the RandomSillyPutty or RSPSummary class.

object

An object of the RandomSillyPutty class.

y

A layout matrix.

col

A character vector containing color names.

Details

The RandomSillyPutty function reads and processes one distance matrix at a time, with a precomputed cluster number, and a number N iterations. RandomSillyPutty returns an s4 object. The MX component of this structure contains an integer vector that has a cluster assignment based on the best scoring silhouette width score from N iterations. The MN contains an integer vector that has a cluster assignment based on the worst scoring silhouette score from N iterations. The ave contains the average silhouette width of all N iteration. The labels is a dataframe containing the cluster assignment of the best scoring slihouette width score per iteration. The minItemSW is a list containing the silhouette width score of all N iterations.

Value

The constructor fnuction, RandomSillyPutty, returns an object of the RandomSillyPutty class.

Slots

MX:

An integer vector containing cluster assignment that had the best silhouette width from running the iterations

MN:

An integer vector containing cluster assignment that had the worst silhouette width from running the iterations

ave:

An integer vector of average distribution of the silhouette width scores throughout N iterations

labels:

A data frame of the cluster assignments of the best silhouette width score.

minItemSW:

A list of silhouette width scores of all N iterations

Methods

plot

signature(x = "RandomSillyPutty", y = "matrix"): Plot the clusterings with the maximum and minimum global silhouette widths.

summary

signature(x = "RandomSillyPutty"): .

Author(s)

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

References

Pending.

Examples

data(eucdist)
# 'eucdist' is the Euclidean distane matrix (i.e., 'dist' object) from
# a simulated data set with 500 elements and 5 groups.
set.seed(12)
y <- RandomSillyPutty(eucdist, 6, N = 100)
summary(y)

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