From the course: Data Science Foundations: Data Mining in Python

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Hierarchical clustering

Hierarchical clustering - Python Tutorial

From the course: Data Science Foundations: Data Mining in Python

Start my 1-month free trial

Hierarchical clustering

- [Instructor] One of the most useful methods for cluster analysis is an exploratory method called a hierarchical clustering. And what makes it exploratory is it actually shows you every possible level of clustering in your data. It's a very common approach, and it has a great visual output. So let's start by loading a number of packages including sklearn and scipy for clustering and visualization. I'm going to load the penguins dataset from the CSV file that I saved previously. And I'm actually going to reduce the number of cases because the graph that we're going to make actually labels every individual case. And if you have a lot, you just can't read it. And we're going to also separate the class variable, drop it from the original dataset, and take a look at the remaining data. So what we have here are the measurements of bill length, bill depth, flipper length, and body mass for five penguins, and we have saved…

Contents