Machine Learning (ML) · Intermediate level

Intermediate level · Module 4: Unsupervised Learning · Lesson 2 of 3

Other Clustering Methods

Use hierarchical clustering and DBSCAN when k-means' assumptions do not fit, and detect outliers.

In this lesson you will

  • Use hierarchical clustering and read a dendrogram
  • Use DBSCAN to find irregular clusters and outliers

Key concepts

hierarchical clusteringdendrogramDBSCANnoise points

The lesson

Hierarchical clustering builds a tree of merges from individual records to one group. A dendrogram shows the tree, and cutting it at a height gives clusters — useful for small data sets and for seeing structure at several levels.

DBSCAN groups points that are densely packed and labels isolated points as noise. It finds clusters of any shape and does not need the number of clusters in advance, but its eps and min_samples settings need care.

Points labelled as noise can be valuable: unusual agents may signal fraud, data errors or special circumstances worth investigating.

Step by step

  1. Build a dendrogram on a sample of agents.
  2. Cut it into clusters and compare with k-means.
  3. Run DBSCAN and count noise points.
  4. Inspect five noise points.

Practice activity

Compare k-means, hierarchical and DBSCAN results on the agent data and choose one approach.

Expected result: A comparison with a justified choice and a note on the outliers found.

Check your understanding

  1. What does a dendrogram show?

    Show answer

    The sequence of merges in hierarchical clustering.

  2. What does DBSCAN do with isolated points?

    Show answer

    It labels them as noise.

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.