Visualizing clustering results
The Clustering package offers multiple clustering algorithms for Julia. These algorithms aim to create groups where the elements in a group are more similar than those between groups. In particular, it provides the hclust function for performing a hierarchical clustering from a distance matrix. It creates a dendrogram, where the most similar data points, known as the leaves, are closer. This means you need to travel fewer and shorter branches from one leaf to another that belong to the same cluster than from visiting leaves outside it. The function returns an object of the Hclust type. The StatsPlots package exports a Plots recipe to draw the dendrogram when you call the plot function with a Hclust object. Let’s create a dendrogram that clusters the variables in the Iris dataset:
- Create a new Pluto notebook.
- Execute the following code in the first cell to load the necessary libraries and the Iris dataset:
begin &...