Analysis of Apriori and FP-Growth Algorithms for Market Basket Insights: A Case Study of The Bread Basket Bakery Sales

Main Article Content

👤 Hery
🏢 Department of Information System, Universitas Pelita Harapan, Tangerang 15811, Indonesia
👤 Andree E. Widjaja
🏢 Department of Information System, Universitas Pelita Harapan, Tangerang 15811, Indonesia

Market basket analysis is a crucial technique in retail for uncovering associations between items frequently purchased together. This study aims to compare the effectiveness of the Apriori and FP-Growth algorithms using sales data from "The Bread Basket" bakery, comprising 20,507 transactions. Key variables include TransactionNo, Items, DateTime, Daypart, and DayType. The data underwent preprocessing steps, including cleaning, tokenization, and feature extraction using TF-IDF. The Apriori and FP-Growth algorithms were implemented with hyperparameter tuning and an 80/20 training/testing split. Performance metrics were evaluated, revealing that Apriori had an execution time of 4.08 seconds and memory usage of 45.36 MiB, whereas FP-Growth exhibited an execution time of 4.15 seconds and significantly lower memory usage at 0.08 MiB. The quality of the association rules was assessed by metrics such as support, confidence, and lift. For example, the Apriori algorithm generated the rule {Alfajores} -> {Coffee} with support 0.018885, confidence 0.520000, and lift 1.087090, while FP-Growth produced the rule {Scone} -> {Coffee} with support 0.017829, confidence 0.519231, and lift 1.085482. FP-Growth generally outperformed Apriori, particularly in memory efficiency, due to its use of the FP-tree data structure, which reduces the need for multiple database scans. The practical implications for "The Bread Basket" bakery include optimizing product placement and inventory management based on the identified associations, such as placing Coffee near Cake or Medialuna to encourage complementary purchases. The study concludes that while both algorithms effectively generate meaningful association rules, FP-Growth's superior memory efficiency makes it more suitable for large datasets. Limitations include data quality and the study's scope, confined to a single bakery. Future research should explore hybrid approaches, real-time data analysis, and applications across different retail sectors to enhance market basket analysis techniques further.

Hery, & Widjaja, A. E. (2024). Analysis of Apriori and FP-Growth Algorithms for Market Basket Insights: A Case Study of The Bread Basket Bakery Sales. Journal of Digital Market and Digital Currency, 1(1), 63–83. https://doi.org/10.47738/jdmdc.v1i1.2

Article Details

Section
Articles