← capítulo

Learning without labels

The answer key is gone.

No label column, no target, no accuracy. The job changes from predicting an answer to finding the structure already in the data.

The frame around the four unsupervised chapters that follow.

The families

One handicap — no labels — and a handful of jobs:

No target column, so no accuracy. That's the whole difficulty.

No labels in, structure out

Same cloud: raw and gray on the left, colored by discovered clusters on the right. Nothing labeled went in.

Are there really four? The data won't tell you. That's the chapter.

The silhouette

For each point: how much better does it fit its own cluster than the nearest other one?

s=bamax(a,b)s = \frac{b - a}{\max(a, b)}

a = mean intra-cluster distance. b = mean distance to the nearest other cluster. Score in [−1, 1], unitless, no labels. The clustering's score is the mean over all points.

How do you know k is right without labels?

Sweep k from 2 to 8. Cluster with k-means, score with the from-scratch silhouette. Watch the metric peak.

Silhouette climbs to its peak of 0.788 (unitless, [−1,1]) at k=4 — the true number of blobs — then falls. No label was used.

Two internal metrics, one answer

Silhouette peaks at k=4 (0.788). Inertia's elbow (data units²) bends at the same k. When they agree, believe them.

Internal vs external

At k=4: silhouette 0.7876 (unitless, [−1,1]), ARI 1.0 (unitless, [−0.5,1]) — perfect recovery. At the wrong k=6: silhouette 0.5657, ARI 0.8329. They move together.

The ARI column only exists because this data came with a sealed envelope. Real data doesn't.

Takeaways