 Hi, as you can see, I'm Nadzala, I'm Noah and I will be filling in for her for the next couple of videos. In our previous video, we started with clustering and discovered that the first step is to define the distance between data instances. Now that we have, let us introduce a simple clustering algorithm and think about what else we might need. When introducing distances, we worked with the grades dataset and reduced it to two dimensions. We got it from the datasets widget and used select columns to construct a dataset that contains only the grades for English and algebra. Notice that I did not have to do anything. Orange remembers how I previously used select columns for this particular dataset. We visualized the data on a scatterplot. The hierarchical clustering algorithm assumes that in the beginning, every data instance, that is, each of our students, is its own cluster. Then, in each step, the algorithm merges the two nearest clusters. In our data, Demi and Nash are closest. So, let's join them into the same cluster. Leah and George are also very close, so next we merge them. Phil is close to the Leah-George cluster, so merging these, we get the Phil-Leah-George cluster. We continue with Bill and Ian, then Cynthia and Fred, and add Jenna to the Cynthia-Fred cluster. Catherine to the Demi-Nash, and Maya to the Phil-Leah-George. Henry joins Anna, and Eve joins Phil-Leah-George-Maya. And now, just with a quick glance, and I could be wrong, I will merge the Bill-Ian cluster to Jenna-Fred-Cynthia. OK, hold on. How do we know which clusters are actually close to each other? How do we actually measure the distances between clusters? Because whatever I've done so far was just an informed guess. I really should be more precise. So, how do I actually know that Bill Ian should be clustered with Jenna, Cynthia, Fred, and then with George Phil-Leah, and then the rest? I need to define the computation of distances between clusters. Remember, in each iteration, we said that hierarchical clustering should join the two nearest clusters. So, how do we measure the distance between the Jenna-Cynthia-Fred and Bill Ian clusters? Note that what we have are the distances between data items. That is, between individual students. There are several ways to do this. The simplest is to define the cluster distance as the distance between the two closest items. We call this single linkage. Cynthia and Bill are the closest. If we use a single linkage, this distance defines the distance between these two clusters. We can also take two data instances that are the farthest away from each other and use their distance to define the cluster distance. This is called complete linkage. Using it, Jenna and Ian represent the cluster distance. In the third variant, we would consider all the pairwise distances. So between Ian and Cynthia, Ian and Fred, Bill and Cynthia, Bill and Jenna, and Bill and Fred, and from them, compute the average distance. This is unsurprisingly called average linkage. Now we can just define the second ingredient we need for hierarchical clustering. Besides ways to measure the distance between data items, we also need a way to compute the distance between clusters. Before, when I started to join clusters manually, I used just a sense of closeness, probably something similar to average linkage. Let me continue in this way for just a while. I will join the Henry Anna cluster to Demi Nash-Catherine, perhaps merge Olga with cluster on the right, and then add the top cluster to the one on the bottom right. Although here, I do not know exactly, I would need something like orange to compute cluster distances for me. Finally, I merge the two remaining clusters. Here, I stop. There's nothing else to merge. The hierarchical clustering algorithm stops when everything is merged into one single cluster. Here is the result of hierarchical clustering on my two-dimensional data set of student grades. It looks messy, but somehow still shows a clustering structure. But there should be a better, neater way of presenting the clustering results. I also still need to answer how many clusters there actually are. There is one better presentation of hierarchical clustering called a dendrogram. I would like to introduce it in my next video. There, I promise to stop executing the clustering manually by eye and instead use orange to do the work for me.