How can customer types be classified? What is “k-means clustering”?

In this blog post, we’ll explore how “k-means clustering” classifies customers into different types and examine real-world use cases.

 

One of the biggest trends among companies today is “customer-tailored services.” As the service paradigm has shifted from seller-centric to consumer-centric, we have moved beyond an era where consumers simply purchased and used products as provided by companies, to an era where consumers directly select products that match their tastes and needs. Consequently, it has become crucial for companies to accurately identify customer needs and design products and services that reflect them. For this reason, companies are categorizing customers into various segments and establishing business strategies tailored to each segment. In fact, there is a case in Canada where the preferences of fair-trade coffee consumers were analyzed to classify them into three purchasing types, and import-export strategies were redefined based on these findings.
As shown here, it was once common to classify customer segments based on the results of direct interviews with individual customers. However, today, the use of “Big Data”—vast amounts of data that were previously difficult for computers to process—has made it possible to classify customer segments in a much more automated manner. For example, consider a department store that receives countless customers every day. The information left by a single customer—including payment records on each floor, which products they showed interest in, and which stores they spent the most time browsing—generates a vast amount of data. In the past, only limited information, such as sales figures by company, could be analyzed; however, with the advancement of computing technology enabling the processing of massive amounts of data, it has become possible to classify customer segments in a more quantitative and systematic manner.
In computer science, this process of categorizing data is called clustering. More precisely, clustering is the process of grouping scattered data into several clusters that share similar characteristics. Most data processed by computers is expressed numerically, and analysts set specific criteria to calculate the similarity between data points. Subsequently, data points with high similarity are grouped into a single cluster, or boundaries are determined to distinguish between different clusters.
K-means clustering is the most representative and fundamental algorithm among these clustering analysis methods. This method aims to minimize the sum of the squares of the distances between the center of each cluster and all data points belonging to that cluster. However, finding the exact optimal solution to this problem is practically difficult due to the extremely high computational cost. Therefore, in practice, we use heuristic methods—which can be likened to “an expert’s know-how”—to efficiently find a solution.
A representative heuristic method is Lloyd’s Algorithm. Let’s revisit the department store example discussed earlier. If we assume the horizontal axis represents “standardized values of customer movement time within the store” and the vertical axis represents “standardized values of customer purchase volume,” then the points located in the lower-left corner can be interpreted as “customers who moved little and purchased little,” while those in the upper-right corner represent “customers who moved a lot and purchased a lot.” In real-world data, a consistent relationship appears between customer movement time and purchase volume, and clusters may be relatively easy to distinguish to the human eye. However, since computers cannot recognize these clusters as intuitively as humans do, they must automatically identify clusters by following a specific procedure.
When performing clustering using the Lloyd algorithm, the first thing the computer does is set multiple “centers” at random locations. It then classifies each data point based on its nearest center. This process is called the Expectation Step (E-Step), during which the algorithm calculates which cluster each data point most appropriately belongs to based on the currently set centers.
The next step is the Maximization Step (M-Step). The average position of each cluster classified in the previous step is calculated to create new centroids. The M-Step involves moving the current centroids to new positions to minimize the distance between the data points within each cluster and their respective centroids. Consequently, this step serves to further improve the effectiveness of the clustering. Thereafter, the E-Step and M-Step are performed iteratively, and clustering continues until the positions of the centroids no longer change significantly. Through this iterative process, stable clusters are gradually formed.
The previous example assumed the existence of two clusters, but in real-world applications, the same principle can be applied to three or more clusters. However, since K-means clustering is a structurally simple algorithm, it has several limitations. The most notable limitation is that every data point must belong to exactly one cluster. Consequently, the algorithm can be significantly influenced by outliers, and clusters may form that differ from what one might intuitively expect. Furthermore, because it is difficult to account for situations where a single data point exhibits characteristics of multiple clusters simultaneously, the resulting clustering may not always be natural. It may also be difficult to achieve the desired results when data is distributed in a way that makes it hard to distinguish clusters along a straight line. Due to these limitations, various clustering techniques—such as Fuzzy C-Means, DBSCAN, Hierarchical Clustering, and the Gaussian Mixture Model—have since been developed and are utilized depending on the situation.
Today, computers rapidly analyze the vast amounts of data constantly generated in daily life and transform it into meaningful information through various methods, such as clustering. The results of these analyses are then applied to people’s daily lives and corporate decision-making, enabling personalized services and data-driven decision-making. Although we are often unaware of the existence of these technologies, they are already playing a crucial role in making our lives more convenient across various fields. Technology that provides tangible benefits to people without being conspicuous can truly be called “true technology.”

 

About the author

Cam Tien

I love things that are gentle and cute. I love dogs, cats, and flowers because they make me happy. I also enjoy eating and traveling to discover new things. Besides that, I like to lie back, take in the scenery, and relax to enjoy life.