View source: R/circular_silhouette.R
circular.sil | R Documentation |
A fast linear-time algorithm to calculate silhouette information on circular data with cluster labels.
circular.sil(O, cluster, Circumference, method = c("linear", "quadratic"))
O |
a numeric vector of circular data points |
cluster |
an integer vector of cluster labels for each point |
Circumference |
a numeric value giving the circumference of the circle |
method |
a character value to specify the algorithm to calculate
the silhouette information. The default value is |
If method
takes the value of "linear"
(default), the
silhouette information on circular data is calculated by a fast
linear-time algorithm; if method
is "quadratic"
,
a quadratic-time algorithm is used instead to calculate silhouette
by definition. There is an overhead of sorting O(n log n) if the
input data are not sorted.
One important assumption is that a cluster cannot be contained in another cluster in the input cluster labels.
The function returns a numeric value of the average silhouette information calculated on the input circular data clusters.
O <- c(-1.2, -2, -3, -2.5, 1, 0.8, 1.5, 1.2) cluster <- c(1, 1, 1, 1, 2, 2, 2, 2) circular.sil(O, cluster, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.