RandomSillyPutty-class | R Documentation |
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.
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, ...)
distobj |
An object of class |
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 |
x |
An object of the |
object |
An object of the |
y |
A layout matrix. |
col |
A character vector containing color names. |
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.
The constructor fnuction, RandomSillyPutty
, returns an object
of the RandomSillyPutty
class.
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
signature(x = "RandomSillyPutty", y = "matrix")
: Plot the
clusterings with the maximum and minimum global silhouette widths.
signature(x = "RandomSillyPutty")
: .
Kevin R. Coombes krc@silicovore.com, Dwayne G. Tally dtally110@hotmail.com
Pending.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.