Skip to main content
Copertina articolo: Cluster analysis customer segmentation: K-means and DBSCAN
Articles/Data Science

Cluster analysis customer segmentation: K-means and DBSCAN

/

In 2011 Netflix faced a significant challenge: with 23 million subscribers, each with unique vision habits, recommending content in a generic way was ineffective, while customizing each experience individually was impossible. The answer was segmenting users into distinct behavioral clusters, such as the “completelist” that ends each series, the “hopper” that jumps between many series, and the “re-watcher” that reviews content. This segmentation allowed Netflix to increase the retintion, with an estimated value of over a billion dollars per year.

This example illustrates the power of clustering in marketing: transforming an indistinct mass of customers into homogeneous groups, on which to build differentiated and measurable strategies.

Why traditional demographic segmentation is not enough

Segregating customers only for age, gender or income was sensible in the age of television, but in digital marketing, where every interaction is traceable, this segmentation is too gross. Airbnb, for example, discovered through behavioral cluster analysis an unexpected segment of women hosts over 60 years old with small properties in coastal cities, with higher engagement and retention performances than suggested by traditional demographic data.

Behavioral clustering allows data to define natural boundaries between groups, without prejudice to relevant variables.

The RFM framework: a solid starting point

The RFM framework (Recency, Frequency, Monetary) is still one of the most effective approaches to segmenting e-commerce and SaaS customers. It measures:, Recency: how recently a customer made a purchase., Frequency: how many times he bought in a defined period., Monetary: how much he spent overall.

This three-dimensional space allows to quantify significant differences between customers and to apply clustering algorithms to identify homogeneous groups.

K-means: the main method for segmentation

K-Means is the most widely used algorithm for customer segmentation thanks to its interpretability, speed and stability. Iteratively works:

  1. You choose the number of clusters K and randomly place the centroids. 2. Each data point is assigned to the nearest centroid by calculating the distance euclidean. 3. Centroids are updated as average of the assigned points. 4. The process is repeated until the centroids stabilize.

The standardization of variables is basic to prevent variables with different scales from controlling distance.

Choose the number of k clusters

The choice of K cannot be arbitrary. Two useful tools are:

  • Elbow Method: the decrease in inertia as K grows and the point where improvement is drastically reduced is identified., Silhouette Score: measures the cohesion and separation of clusters; values above 0.5 indicate well defined clusters.

The ideal is that both methods agree, but also the practicality of business must guide the decision.

From clustering to action

The true value of segmentation lies in the resulting actions. A typical operating flow starts from raw data, calculates RFM, standardizes, applies K-Means, profils clusters, assigns company labels and defines actions specific to each segment. For example, a VIP segment could receive exclusive loyalty programs, while a segment at risk churn could be the subject of reactivation campaigns.

Over k-means: other algorithms for complex clustering

K-Means works well with spherical clusters, but when data has complex forms or outliers, other algorithms are more suitable:

  • DBSCAN identifies clusters based on density, does not require K a priori and automatically identifies outliers., Hierarchical Clustering builds a cluster hierarchy that can be displayed with dendrograms, useful for exploring multilevel structures., Gaussian Mixture Models (GMM) assigns cluster probability, reflecting the nuanced nature of real segmenting.

Validation and strategic use of clusters

It is not enough to create clusters: we need to verify the separableness, stability and above all the possible action on each. If the segments do not lead to differentiated strategies, clustering is useless. Validation includes statistical and business metrics, such as intra- vs inter-cluster distance, time consistency and effectiveness of the actions undertaken.

Case study: multi-category e-commerce

An e-commerce with five main categories applied RFM and K-Means to obtain four distinct segments (VIP, Regulars, A Risk, One-Shot), each with specific marketing behaviours and strategies. Targeted actions led to a 23% increase in turnover in six months and significant improvements in retention and repurchase metrics.

Conclusion: clustering as a continuous process

Clustering is not a project to be completed once and for all, but a marketing operating system that evolves with customer data and behaviour. Successful companies, such as Netflix and Airbnb, continuously update their models to maintain relevance and maximize value. Only then does segmentation become a decision tool under uncertainty, capable of driving effective and measurable actions.

Related articles

Predicting university drop-out: Italian data analysis
February 28, 20261 min read
Read
Conjoint analysis: pricing and product based on real data
February 28, 20261 min read
Read
Analytics in cycling: Power, cadence and performance with data
February 28, 20261 min read
Read