Tech moves fast, but you're still playing catch-up?
That's exactly why 200K+ engineers working at Google, Meta, and Apple read The Code twice a week.
Here's what you get:
Curated tech news that shapes your career - Filtered from thousands of sources so you know what's coming 6 months early.
Practical resources you can use immediately - Real tutorials and tools that solve actual engineering problems.
Research papers and insights decoded - We break down complex tech so you understand what matters.
All delivered twice a week in just 2 short emails.

Last time, GMM didn't just find your friend group. It told you how much you belonged to each one.
Soft assignments. Overlapping bells. Probabilistic nuance.
But today's contestant?
They walk in with a ruler, a clipboard, and a very specific vision of how things should be organized.
Please welcome Hierarchical Clustering — the algorithm that doesn't just find clusters. It builds a family tree.


📈 Hierarchical Clustering ”The Family Tree Builder”
Most clustering algorithms need one thing upfront: tell me how many clusters you want.
K-Means? "How many groups?"
GMM? "How many bells?"
Hierarchical Clustering doesn't ask that question.
Instead, it says: "Let me show you the structure of the data at every level — and you decide where to cut."
It builds a full hierarchy of clusters, from the bottom up (or top down), and hands you a visual map of how everything connects.
That map is called a dendrogram. More on that in a second.

Hierarchical Clustering is an unsupervised learning algorithm that builds a tree-like structure of clusters by progressively merging the closest data points. The result is a dendrogram — a visual map of how everything connects, where you decide how many clusters you want by choosing where to "cut" the tree.

🧠 Play By Play: How Hierarchical Clustering Works
There are two flavors. Today we're covering the most common one: Agglomerative (bottom-up).
1️⃣ Start With Every Point As Its Own Cluster
At the very beginning, every single data point is its own cluster.
100 data points? 100 clusters.
Lonely, but organized.
2️⃣ Find The Two Closest Clusters And Merge Them
The algorithm looks at every pair of clusters and asks: "Who's closest?"
Whatever two clusters are nearest to each other, they merge into one.
Now you have 99 clusters.
3️⃣ Repeat
Find the next two closest. Merge them.
98 clusters.
Keep going.
4️⃣ Until Everything Is One Big Cluster
Eventually, every data point has been merged into a single cluster.
The algorithm is done — but the real output isn't the final cluster. It's the entire history of mergers.
That history is the dendrogram.
5️⃣ Read The Dendrogram, Pick Your Cut
A dendrogram is a tree diagram that shows every merge that happened, from the first (closest points) to the last (everything combined).
The height of each branch tells you how far apart those clusters were when they merged.
You pick a horizontal line to "cut" the tree — and wherever you cut, that's your clusters.
Cut high → fewer, broader clusters.
Cut low → more, granular clusters.
No need to decide upfront. The data shows you the options.

TLDR: Hierarchical Clustering Mood Board
Step | What It Does | Vibe |
|---|---|---|
1 | Every point starts alone. | “We don’t know each other yet.” |
2 | Merge the two closest. | “You seem familiar.” |
3 | Keep merging. | “Birds of a feather.” |
4 | Until one big cluster remains. | “We’re all connected.” |
5 | Cut the dendrogram. | “Here’s where I draw the line.” |

Recap
Hierarchical Clustering doesn't force a decision. It maps out every possible grouping and lets you choose what makes sense.
Where K-Means said "pick a number," and GMM said "here are your probabilities," Hierarchical Clustering says: "Here's the full picture. You decide."
It's one of the most interpretable algorithms in unsupervised learning, and often the best starting point when you're exploring data you don't fully understand yet.
And with that, the Unsupervised Learning algorithm series is officially a wrap. 🎉
Before you go…
If you’ve been following along and want to go beyond just the theory, I just launched The Gradient Descent Pro Tier. This is brand new.
Right now, I’m offering the Founding Members Plan, normally 10 bucks a month, but the first 100 subscribers lock in at half that. 5 bucks a month, for life.
Here's what you get every single week:
🧪 A coding exercise for every topic — not just theory. You'll actually build things in Python and see ML work with your own hands.
📝 A practice quiz with 3 difficulty levels — Easy to check your understanding, Medium to push yourself, Hard to humble you.
📕 A visual cheatsheet — beautifully designed, no fluff. The kind of reference you'll actually want to keep open.
🎟️ Discount codes for all e-books — Anytime I release a new book. Because why not?
Check it out:
Thanks for sticking with me, and feel free to email me anytime. Till next time!


