| cluster_hclust | R Documentation |
Agglomerative hierarchical clustering using stats::hclust.
cluster_hclust(
k = 2,
h = NULL,
method = "ward.D2",
dist = "euclidean",
scale = TRUE
)
k |
number of clusters to cut the tree (default 2) |
h |
height to cut the tree (optional; if provided, overrides |
method |
linkage method passed to |
dist |
distance method passed to |
scale |
logical; whether to scale data before distance (default TRUE) |
Computes a distance matrix (optionally after scaling) and builds a dendrogram. Clusters are
obtained by cutting the tree with k (number of clusters) or h (height).
returns a hierarchical clustering object.
Johnson, S. C. (1967). Hierarchical clustering schemes. Psychometrika.
data(iris)
model <- cluster_hclust(k = 3)
model <- fit(model, iris[,1:4])
clu <- cluster(model, iris[,1:4])
table(clu)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.