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

Description Usage Arguments Value Author(s) References Examples

View source: R/compute_inertia_ahc.R

Description

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

Usage

1
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

1
2
3
4
5
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

helda documentation built on Jan. 6, 2021, 5:09 p.m.