| silinfo_widths | R Documentation |
Per-sample silhouette widths
silinfo_widths(x, k)
x |
a |
k |
a single value among the candidate |
Extract the fine-grained silhouette information of one k from an nk()
result: one row per sample, with the cluster the sample was assigned to, its
neighbour cluster and its silhouette width.
a data.frame with one row per sample and the columns sample,
cluster, neighbor and sil_width. The rows keep the order in which the
clusterer returned them – for cluster::pam() that is by cluster and, within
a cluster, by decreasing sil_width – so the rows should be aligned by
sample rather than by position. The per-cluster average silhouette widths
are attached as the "clus.avg.widths" attribute, and are also available as
x$silinfo[[i]]$clus.avg.widths, where i is the position of k in x$k.
Guangchuang Yu
nk(), autoplot()
x <- nk(iris[,-5], 2:4)
head(silinfo_widths(x, 3))
attr(silinfo_widths(x, 3), "clus.avg.widths")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.