mst.cluster {mstclustering} | R Documentation |
mst.cluster
Description
Run clustering using MST. Before calling this function, remove some edges from the MST, for example the k-1 heaviest.
Usage
mst.cluster(child.list.mst, m, k)
Arguments
child.list.mst |
The return value of the gen.child.list.mst() function with k-1 edges removed. |
m |
Number of nodes. |
k |
The number of clusters. |
Value
A vector whose k-th element is the cluster the k-th point belongs to.
Examples
iris.clean <- iris[,-5]
iris.dist <- as.matrix(dist(iris.clean))
iris.edge.list <- gen.edge.list(iris.dist)
m <- nrow(iris.dist)
iris.mst.edge.list <- kruskal(iris.edge.list, m)
k <- 3
n.edges <- nrow(iris.mst.edge.list)
iris.mst.edge.list <- iris.mst.edge.list[1:(n.edges - (k - 1)),]
iris.child.list.mst <- gen.child.list.mst(iris.mst.edge.list, m)
iris.clust.mst <- mst.cluster(iris.child.list.mst, m, k)
[Package mstclustering version 1.0.0.0 Index]