E-commerce sites get a lot of transaction data from people in different countries who like different kinds of products. It is very important to know how people buy things based on their country and the type of product they buy in order to come up with better and more efficient marketing plans. This study seeks to discern product purchasing patterns by country through the application of the K-Means clustering algorithm on international e-commerce transaction data. This study utilized a dataset comprising 6,000 e-commerce transaction records, characterized by two primary variables: country and product category. Several methods were used in the preprocessing stage. For example, missing values were replaced to deal with missing data, nominal data was changed to numerical data to change categorical data into numerical data, and Z-transformation was used to normalize the data so that it was all on the same scale. We used the K-Means algorithm to group data into clusters with different k values, such as k=2, 5, 10, 15, 20, and 25. We then used the average within centroid distance metric and the elbow method to find the best number of clusters. The elbow method analysis showed that the best number of clusters was k=10, which showed a big drop in the average within centroid distance value. The ten clusters with algorithms K-Means that were made show very specific market segmentation, with each cluster having its own set of countries and product categories that are most popular.
Copyrights © 2026