Skip to contents

Produces a styled gt table showing cluster sizes and mean feature values. Supports kmeans, pam, clara, dbscan, and hclust models.

Usage

tl_table_clusters(model, k = 3, digits = 2, ...)

Arguments

model

A tidylearn clustering model object

k

For hclust models, the number of clusters to cut (default: 3)

digits

Number of decimal places (default: 2)

...

Additional arguments (currently unused)

Value

A gt table object.

Examples

# \donttest{
model <- tl_model(iris[, 1:4], method = "kmeans", k = 3)
tl_table_clusters(model)
Cluster Summary
kmeans | 3 clusters
Cluster Size Sepal.Length Sepal.Width Petal.Length Petal.Width
1 50 5.01 3.43 1.46 0.25
2 62 5.90 2.75 4.39 1.43
3 38 6.85 3.07 5.74 2.07
tidylearn | kmeans | n = 150
# }