Journal of Artificial Intelligence and Engineering Applications (JAIEA)
Vol. 5 No. 2 (2026): February 2026

Segmentation of Coffee Purchasing Behavior Based on Transaction Time Using the K-Means Algorithm

Yuslia Devitri (Unknown)
Rahaningsih, Nining (Unknown)
Ali, Irfan (Unknown)
Prihartono, Willy (Unknown)



Article Info

Publish Date
15 Feb 2026

Abstract

This studyaims to identify customer behavior patterns based on the time of purchaseof beverages at a coffee shop using the K-Means method.Transaction data includes purchase time, payment type, product name,time category, day, and month. The research stages include data cleaning, time attribute transformation, and numerical feature normalization. The optimal number of clustersis determined through testing k = 2–10 with four evaluation metrics,namely Inertia, Silhouette Score, Davies–Bouldin Index, and Calinski–HarabaszIndex. Based on the validation results, k = 3 was selected because it provided the best balancebetween compactness and cluster separation. The clustering results showedthree main customer groups based on transaction time trends:nighttime buyers with a peak around 10:27 p.m., afternoon to early evening buyerswith a centroid of 7:01 p.m., and morning to noon buyers with a centroid11:13. The frequency distribution indicates that the morning–afternoon buyer groupis the largest, while the early evening–night group is thesmallest. Visualization of scatter plots, boxplots, and time category graphsemphasizes the differences in characteristics between clusters. Overall,this study proves that K-Means is effective in mapping the temporal patternsof customer behavior. These findings can be used to develop time-based marketing strategies, operational arrangements, and product stock management,as well as form the basis for further analysis in the industry.

Copyrights © 2026






Journal Info

Abbrev

JAIEA

Publisher

Subject

Automotive Engineering Computer Science & IT Control & Systems Engineering

Description

The Journal of Artificial Intelligence and Engineering Applications (JAIEA) is a peer-reviewed journal. The JAIEA welcomes papers on broad aspects of Artificial Intelligence and Engineering which is an always hot topic to study, but not limited to, cognition and AI applications, engineering ...