O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

The hierarchical clustering technique tries to build a hierarchy of clusters iteratively using either of the following two approaches:

  • Agglomerative hierarchical clustering: This is a bottom-up approach. Each observation starts in its own cluster. We then compute the similarity (or the distance) between each cluster and then merge the two most similar ones at each iteration until there is only one cluster left.
  • Divisive hierarchical clustering: This is a top-down approach. All observations start in one cluster, and we then split the cluster into the two least dissimilar clusters recursively until there is one cluster for each observation.

In this recipe, we perform hierarchical clustering on the European protein intake data. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required