A product team may know its users’ demographics but still struggle to explain why some embrace recommendations while others only browse. Clustering groups similar data points without labeled learning targets, helping teams discover patterns in data that is not yet well understood. The resulting segments can inform personalization, marketing, and feature decisions, but the patterns found are not automatically useful. section 4.1 section 3.1.2 section 4.1.5
For behavioral segmentation, choose features that reflect the product question. Recommendation clicks, purchases, browsing, and profile edits can reveal patterns that demographic categories miss. Clean and aggregate the data, then use domain expertise to select, scale, and refine features: a valid grouping based on irrelevant features may be of little practical value. section 4.1.1 section 4.1.3 section 4.1.5
Different methods expose different structures, so compare them against the data and the insight sought:
- K-means assigns points to their nearest center, recalculates centers from cluster averages, and repeats until groups stabilize. It requires a preset number of clusters. section 4.1.3
- Hierarchical clustering builds a tree of clusters, allowing exploration from broader groups to more specific behaviors without predefining the number of clusters. section 4.1.3
- DBSCAN identifies dense groups and can reveal arbitrary-shaped clusters and outliers, unlike the spherical clusters assumed by K-means. section 4.1.3
Figure 4.2 K-means clustering looks for centroids surrounded by an agglomeration of data points.
The figure illustrates K-means centers surrounded by groups of data points. section 4.1.3
Evaluate whether segments are distinct and useful. The silhouette coefficient reflects similarity within clusters relative to other clusters; the Calinski-Harabasz index helps assess separation and choose a cluster count. Iterate on features, preprocessing, and algorithm parameters. Too few groups can conceal meaningful differences; too many can overwhelm the team expected to act on them. section 4.1.4 section 4.1.5
From segments to action
An e-commerce team identifies users who frequently edit profiles, ignore recommendations, browse without buying, or engage deeply and purchase often. Visualizing and describing the groups helps the team tailor experiences. An anomalous user who clicks endlessly without buying turns out to be a scraping bot, prompting a security alert. To assign new users without repeatedly rerunning clustering, the team proposes training a supervised classifier on the existing segments. section 4.1.6


















