best.cutree: Optimal partition based on the higher relative loss of...

View source: R/clustering.R

best.cutreeR Documentation

Optimal partition based on the higher relative loss of inertia

Description

This function calculates the best partition to cut a dendrogram based on the higher relative loss of inertia criteria. This criteria was originaly proposed by the HCPC function of the package FactoMineR.

Usage

best.cutree(hc, min = 3, max = 20, loss = FALSE, graph = FALSE, ...)

Arguments

hc

a clustering tree (an object of class hclust, dendrogram or agnes)

min

the minimum number of classes

max

the maximum number of classes

loss

if TRUE, will return the relative loss of inertia of each partition instead of the best partition

graph

if TRUE, will plot the relative loss of inertia of each partition, the best partition being indicated in black and the second best in grey

...

additional arguments sent to plot (if graph = TRUE)

See Also

HCPC

Examples

hc <- hclust(dist(USArrests), "ave")
best.cutree(hc)
best.cutree(hc, loss = TRUE)
best.cutree(hc, graph = TRUE)
best.cutree(hc, graph = TRUE, min = 6, max = 15)

larmarange/JLutils documentation built on March 24, 2023, 6:39 a.m.