View source: R/compute_inertia_ahc.R
compute_inertia_ahc | R Documentation |
This function allows to compute the inter group inertia from agglomerative clustering for different number of clusters
compute_inertia_ahc(data, method = "ward.D", max_clusters = 10)
data |
a R data frame (all columns are required to be numeric types). |
method |
a character. This specifies the method on which the agglomerative is built upon (by default set to "ward.D") |
max_clusters |
an integer. The maximal number of clusters for which we intend to compute inter group inertia |
a vector of length max_clusters
containing the inter group inertia for agglomerative
clustering. The ith value of the vector corresponds to the inter group inertia from agglomerative
clustering run with i clusters.
Simon CORDE
Link to the author's github package repository: https://github.com/Redcart/helda
library(dplyr) # We select only numeric features from Iris data set data <- iris %>% select(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) result <- compute_inertia_ahc(data = data, max_clusters = 15) result
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.