25 customers, no labels 0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 weekday visits weekend visits
A café counted how often each customer came in one month: weekday visits across, weekend visits up. In unit 4 every day had a class; here there is none. Nobody wrote which customer belongs to which group; the algorithm only has these 25 points.
Similarity is measured as distance 0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 weekday visits weekend visits 8.60
The distance between customer 2 and customer 3 is 8.60. Without labels, the only thing that says how alike two examples are is the difference in their features. A small distance means the two customers come to the café about as often.
A neighbourhood of 2 units 0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 weekday visits weekend visits
The circle is around customer 2, with a radius of 2 units. 3 more customers fall inside it. A point with a crowded neighbourhood sits inside a cluster; DBSCAN works on this idea.
Joining the close ones 0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 weekday visits weekend visits
Every two customers no more than 2 units apart are joined by a line. Customers joined to each other form a group, and 4 groups came out. The largest groups with two or more customers are coloured, at most four of them. With no labels given, the data showed its own groups; this is called clustering.
The loneliest customer 0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 weekday visits weekend visits 5.00
The nearest neighbour of customer 13 is 5.00 units away; no other customer is this alone. A point this far from the rest is either a measurement error or an interesting case. Systems that catch card fraud and machine faults look for points like this.
The unit of distance 0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 weekday visits weekend visits
Both axes are visit counts. So one unit is drawn the same length in both directions, and the distance you see matches the distance computed. With two features in metres and grams, the one with bigger numbers dominates the distance; the features are then brought to the same scale first. We will do that in the PCA topic.
What unsupervised learning does 0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 weekday visits weekend visits
Unsupervised learning has three jobs: splitting similar examples into clusters, reducing many features to a few, and finding outliers. This unit covers k-means, hierarchical clustering and DBSCAN for clustering, and PCA for reducing dimensions. They all ask the same question: which examples are close to each other?