compute_inertia_ahc: Intra group inertia for choosing the optimal number of...

View source: R/compute_inertia_ahc.R

compute_inertia_ahcR Documentation

Intra group inertia for choosing the optimal number of clusters in Agglomerative Clustering

Description

This function allows to compute the inter group inertia from agglomerative clustering for different number of clusters

Usage

compute_inertia_ahc(data, method = "ward.D", max_clusters = 10)

Arguments

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

Value

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.

Author(s)

Simon CORDE

References

Link to the author's github package repository: https://github.com/Redcart/helda

Examples

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

Redcart/helda documentation built on March 3, 2023, 11:55 p.m.