O'Reilly logo

MATLAB for Machine Learning by Giuseppe Ciaburro

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

Similarity measures in hierarchical clustering

Earlier, we said that clustering involves identifying groupings of data. This is possible thanks to the measure of proximity between elements. The term proximity is used to refer to either similarity or dissimilarity. Let's see, then how this can be done in MATLAB.

In MATLAB, we can use the pdist function to calculate the distance between every pair of objects in a dataset. For a dataset made up of k objects, there are k*(k – 1)/2 pairs in the dataset. The result of this computation is commonly known as a distance or dissimilarity matrix; the following figure shows an example:

Figure 6.4: Distance ...

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