Description Usage Arguments Value Examples
Analogous in structure to silinfo and neiinfo, it computes a "widths" matrix assessing how well each data point belongs to its cluster. Here, this measure is the ratio of two distances: in the numerator, the distance from the point to the nearest cluster center, and in the denominator, from the point to its own cluster center.
1 |
cluster |
named vector |
data |
matrix with raw data |
silwidths |
matrix with silhouette widths |
list with component widths. The widths object is a matrix with one row per data item, with column med_ratio holding the sharpness measure.
1 2 3 4 5 6 7 8 9 | # construct a manual clustering of the iris dataset
iris.data = iris[, 1:4]
rownames(iris.data) = paste0("iris_", seq_len(nrow(iris.data)))
iris.dist = dist(iris.data)
iris.clusters = setNames(as.integer(iris$Species), rownames(iris.data))
# compute sharpnessvalues based on medoids
iris.silinfo = silinfo(iris.clusters, iris.dist)
medinfo(iris.clusters, iris.data, iris.silinfo$widths)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.