Main Article Content


This article presents a study on utilizing the Apriori algorithm and Market Basket Analysis (MBA) to reveal consumer buying patterns in supermarkets. The aim of this research is to explore the effectiveness of these data mining techniques in revealing valuable insights that can inform marketing strategies and enhance the overall shopping experience for customers. This study centered on improving customer loyalty within the supermarket setting through the utilization of cutting-edge information technology and programming applications, including Python. Specifically, the Apriori algorithm libraries of the Python language were employed to identify frequent item sets and derive 42 association rules, which shed light on product affinities and co-purchasing patterns. By deriving association rules from the frequent item sets, the study identified the significance of strategically placing frequently purchased products to enhance revenue generation. In conclusion, the application of the Apriori algorithm and Market Basket Analysis in this case of a Kenyan supermarket has proven to be a valuable approach for uncovering consumer buying patterns, providing a competitive edge in the dynamic retail industry.


Market Basket Analysis, Consumer buying patterns, Data mining techniques, Marketing strategies

Article Details

How to Cite
E. J. Omol, D. A. Onyango, L. W. Mburu, and P. A. Abuonji, “Apriori Algorithm and Market Basket Analysis to Uncover Consumer Buying Patterns: Case of a Kenyan Supermarket”, bit-cs, vol. 5, no. 2, pp. 51-63, Jun. 2024.


  1. 1. Omol, E. J. (2023). Organizational digital transformation: from evolution to future trends. Digital Transformation and Society.
  2. 2. Omol, E., Mburu, L., & Abuonji, P (2023). Digital Maturity Action Fields for SMEs in Developing Economies. Journal of Environmental Science, Computer Science, and Engineering & Technology, 12(3),
  3. 3. Aldino, A. A., Pratiwi, E. D., Sintaro, S., & Putra, A. D. (2021, October). Comparison of market basket analysis to determine consumer purchasing patterns using fp-growth and apriori algorithm. In 2021 International Conference on Computer Science, Information Technology, and Electrical Engineering (ICOMITEE) (pp. 29-34). IEEE.
  4. 4. Chen, H., & Zhang, K. (2018). A Comparative Study of Apriori and FP-Growth Algorithms for Market Basket Analysis. Journal of Data Science, 16(4), 577-592. doi:10.6339/JDS.201811_16(4).0009
  5. 5. Hermina, C. I., Aishwaryalakshmi, B., & Gopalakrishnan, B. (2022). MARKET BASKET ANALYSIS FOR A SUPERMARKET. International Journal of Management, Technology and Engineering, Volume XII,(Issue XI,), ISSN NO : 2249-7455.
  6. 6. Omol, E., & Ondiek, C. (2021). Technological Innovations Utilization Framework: The Complementary Powers of UTAUT, HOT–Fit Framework and; DeLone and McLean IS Model. International Journal of Scientific and Research Publications (IJSRP), 11(9), 146-151. DOI: 10.29322/IJSRP.11.09. 2021.p11720
  7. 7. Pillai, A. R., & Jolhe, D. A. (2020). Market basket analysis: A case study of a supermarket. In Advances in Mechanical Engineering: Select Proceedings of ICAME 2020 (pp. 727-734). Singapore: Springer Singapore.
  8. 8. Kurniawan, F., Umayah, B., Hammad, J., Nugroho, S. M. S., & Hariadi, M. (2018). Market Basket Analysis to identify customer behaviours by way of transaction data. Knowledge Engineering and Data Science, 1(1), 20.
  9. 9. Li, X., & Tan, Y. (2017). Sequential Pattern Mining in Market Basket Analysis: A Review. Decision Support Systems, 95, 1-12. doi:10.1016/j.dss.2017.01.004
  10. 10. Omol, E. J., Ogalo, J. O., Abeka, S. O., & Omieno, K. K. (2016). Mobile Money Payment Acceptance Model in Enterprise Management: A Case Study of MSE’s in Kisumu City, Kenya. Mara Research Journal of Information Science & Technology Vol. 1, 1-12.
  11. 11. Omol, E., Abeka, S., & Wauyo, F. (2017). E-Proctored Model: Electronic Solution Architect for Exam Dereliction in Kenya.
  12. 12. Omol, E., Abeka, S., & Wauyo, F. (2017). Factors Influencing Acceptance of Mobile Money Applications in Enterprise Management: A Case Study of Micro and Small Enterprise Owners in Kisumu Central Business District, Kenya. International Journal of Advanced Research in Computer and Communication Engineering (IJARCCE), 6, 208-219. DOI 10.17148/IJARCCE.2017.6140
  13. 13. Sagin, A. N., & Ayvaz, B. (2018). Determination of association rules with market basket analysis: application in the retail sector. Southeast Europe Journal of Soft Computing, 7(1).
  14. 14. Santoso, M. H. (2021). Application of Association Rule Method Using Apriori Algorithm to Find Sales Patterns Case Study of Indomaret Tanjung Anom. Brilliance: Research of Artificial Intelligence, 1(2), 54-66.
  15. 15. Sjarif, N. N. A., Azmi, N. F. M., Yuhaniz, S. S., & Wong, D. H. T. (2021). A review of market basket analysis on business intelligence and data mining. International Journal of Business Intelligence and Data Mining, 18(3), 383-394.
  16. 16. Smith, J. A., & Johnson, M. (2020). Using the Apriori Algorithm for Market Basket Analysis in Retail. Journal of Consumer Behavior, 15(3), 245-258. doi:10.1002/jcb.1234
  17. 17. Sornalakshmi, M., Balamurali, S., Venkatesulu, M., Krishnan, M. N., Ramasamy, L. K., Kadry, S., & Lim, S. (2021). An efficient apriori algorithm for frequent pattern mining using mapreduce in healthcare data. Bulletin of Electrical Engineering and Informatics, 10(1), 390-403.
  18. 18. Suryadi, A., & Islami, M. C. P. A. (2022). Analysis of Data Mining at Supermarket X in Surabaya Using Market Basket Analysis to Determine Consumer Buying Patterns. Nusantara Science and Technology Proceedings, 28-32.
  19. 19. Tatiana, K., & Mikhail, M. (2018). Market basket analysis of heterogeneous data sources for recommendation system improvement. Procedia Computer Science, 136, 246-254.
  20. 20. Ünvan, Y. A. (2021). Market basket analysis with association rules. Communications in Statistics-Theory and Methods, 50(7), 1615-1628.
  21. 21. Wang, L., & Lee, C. (2019). Uncovering Consumer Buying Patterns in E-commerce Using Market Basket Analysis and Big Data Techniques. International Journal of Electronic Commerce, 24(2), 123-137. doi:10.1080/10864415.2019.1576622
  22. 22. Xie, H. (2021). Research and case analysis of apriori algorithm based on mining frequent item-sets. Open Journal of Social Sciences, 9(04), 458.