R - Hierarchical Clustering

> Procedural Languages > R

1 - About

2 - Steps

2.1 - Data Generation

2.2 - Apply Model

2.2.1 - Method

2.2.1.1 - Complete
hc.complete=hclust(dist(xclustered),method="complete")
plot(hc.complete)
2.2.1.2 - Single
hc.single=hclust(dist(xclustered),method="single")
plot(hc.single)
2.2.1.3 - Average
hc.average=hclust(dist(xclustered),method="average")
plot(hc.average)

2.2.2 - Cut the tree

The function cutree cut the tree at level 4.

hc.cut=cutree(hc.complete,4)

It will produce a vector of numbers from 1 to 4, saying which branch each observation is on.

Advertising
lang/r/hierarchical_clustering.txt · Last modified: 2017/02/12 21:02 by gerardnico