powered by
Plot inertia, absolute loss and relative loss from a classification tree
plot_inertia_from_tree(tree, k_max = 15)get_inertia_from_tree(tree, k_max = 15)
get_inertia_from_tree(tree, k_max = 15)
A ggplot2 plot or a tibble.
ggplot2
A dendrogram, i.e. an stats::hclust object, an FactoMineR::HCPC object or an object that can be converted to an stats::hclust object with stats::as.hclust().
stats::as.hclust()
Maximum number of clusters to return / plot.
hc <- hclust(dist(USArrests)) get_inertia_from_tree(hc) plot_inertia_from_tree(hc)
Run the code above in your browser using DataLab