Hierarchical Clustering: Building a Tree of Groups
Learn how hierarchical clustering merges the nearest groups into a tree, and how SurgeFlow uses it as one of three voting models.
Category: Machine Learning
In plain English
Hierarchical clustering is a way to sort things into groups by repeatedly joining whichever two are most alike. Picture a room full of people: first the two closest friends join hands, then the next closest pair, and so on, until everyone is linked in one big family tree. That tree is called a dendrogram, and you can "cut" it at any height to choose how many groups you end up with. The computer finds this structure on its own, without anyone telling it the right answer in advance.
What it measures
It measures closeness. Each item (for SurgeFlow, a stock) is described by a list of numbers called features, and "distance" is simply how far apart two items are when you compare those numbers. The method starts with every item alone, then keeps merging the nearest pair, recording each merge as a branch in the tree. Cutting the tree high gives a few big groups; cutting it low gives many small ones. - Start: stocks A, B, C, D are each their own group. - A and B have the most similar feature numbers, so they merge first. - C joins the A-B group next because it is the closest leftover. - Cut the tree here and you get two clusters: {A, B, C} and {D}.
How SurgeFlow uses it
SurgeFlow's ML "market map" tab groups stocks by how their features behave, not by predicting prices. Hierarchical clustering is the third of three clustering models that run side by side. Because no single method is perfect, SurgeFlow blends their results into a consensus, so the final groupings are steadier than any one model alone. This is purely descriptive: it shows which stocks currently look alike, not which ones will go up or down. - Model 1 and Model 2 produce their own groupings. - Hierarchical clustering produces a third, tree-based grouping. - The three "vote" to form a consensus map of similar stocks.
How to read it on the site
Open the ML tab (the "market map" at /ml) to see stocks placed into clusters of look-alike behaviour. Stocks in the same cluster currently share similar feature patterns; stocks far apart on the map are less alike right now. Treat it as a lay-of-the-land overview that helps you spot groups and outliers, not as a list of trades.
What it cannot tell you
Being close in feature space means the numbers look similar; it does NOT prove any economic, business, or cause-and-effect link between those stocks. The clusters are descriptive snapshots that can shift as new data arrives, and the result depends on which features and cut-height were chosen. It gives no buy or sell signal and no forecast, and past groupings are not a prediction of future returns. SurgeFlow is research and education only, never investment advice. - Similar numbers are not proof of a real relationship. - Clusters change over time and with different settings. - No price prediction and no buy/sell signal is implied.