View source: R/find_num_clusters.R
| find.num.of.clusters | R Documentation |
An optimal number of clusters is selected on circular data such that the number maximizes the circular silhouette information.
find.num.of.clusters(O, Circumference, ks = 2:10)
O |
a numeric vector of coordinates of data points along a circle. |
Circumference |
a numeric value giving the circumference of the circle |
ks |
an integer vector representing possible choices for the number of clusters |
Using the circular clustering algorithm in the R package OptCirClust \insertCiteDebnath21OptCirClust, we will examine every value of k in the given choices of number of clusters. We select a k that maximizes the circular silhouette information.
The function returns an integer number that is optimal in maximizing circular silhouette.
library(OptCirClust)
Circumference=100
O=c(99,0,1,2,3,15,16,17,20,50,55,53,70,72,73,69)
K_range=c(2:8)
k <- find.num.of.clusters(O, Circumference, K_range)
result_FOCC <- CirClust(O, k, Circumference, method = "FOCC")
opar <- par(mar=c(0,0,2,0))
plot(result_FOCC, cex=0.5, main="Optimal number of clusters",
sub=paste("Optimal k =", k))
par(opar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.