Design of an Intelligent System for Optimal Discount Allocation in E-commerce Based on Customer Purchase Behavior

Document Type : Original Article

Authors

1 PhD in IT Engineering, Department of Information Technology Engineering (E-commerce) ,Qom university, Qom, Iran.

2 Department of Information Technology Engineering (E-commerce) ,Qom university, Qom, Iran.

3 Department of Statistics, Faculty of Statistics, Mathematics and Computer Science, Allameh Tabataba'i University, Tehran, Iran.

4 Department of Information Technology Engineering (E-commerce), K.N. Toosi University of Technology, Tehran, Iran.

10.22091/jdaid.2026.16144.1071

Abstract

This study presents an intelligent, data-driven framework to optimize discount allocation strategies within e-commerce environments. Rather than deploying standard uniform promotional tactics, this research proposes a prescriptive model that segments customers based on transaction history to maximize aggregate profitability and mitigate high-value customer attrition.Utilizing an empirical transaction dataset containing 4,570 validated purchase records from 1,000 unique customers, we calculate Recency, Frequency, and Monetary (RFM) vectors. Following min-max normalization, K-means clustering partitions the customer base. The optimal cluster structure (K=4) is formally validated using the Silhouette Coefficient (S) and the Davies-Bouldin Index (DB) alongside the traditional elbow method. We then formulate a constrained non-linear optimization model utilizing a logistic customer response function to analytically derive segment-specific discount rates that maximize expected net profit under a fixed marketing budget constraint. The empirical system identified four distinct customer archetypes: loyal high-value, at-risk, recent low-frequency, and inactive low-value customers. Compared to a baseline uniform 10 percent discount policy, the proposed optimized framework increased total profit from $184,965.74 to $197,556.92, representing an 8.7 percent improvement. Net profit margins expanded from 21.8 percent to 23.4 percent.Concurrently, high-value customer churn decreased by 12.3 percentage points, a reduction proven statistically significant via McNemar's test (p < 0.001), while promotional waste in low-value segments was entirely eliminated.These findings demonstrate that integrating behavioral clustering with constrained optimization structures yields significantly higher economic returns and customer retention compared to uniform pricing approaches. The proposed system is highly interpretable, computationally efficient, and directly applicable for deployment within small-to-medium enterprise (SME) e-commerce platforms.

Keywords

Main Subjects


Anitha, P., & Patil, M. M. (2022). RFM model for customer purchase behavior using K Means algorithm. Journal of King Saud University: Computer and Information Sciences, 34(5), 1785–1792. https://doi.org/10.1016/j.jksuci.2019.12.011
Athey, S., & Imbens, G. (2016). Recursive partitioning for heterogeneous causal effects. Proceedings of the National Academy of Sciences, 113(27), 7353–7360. https://doi.org/10.1073/pnas.1510489113
Awaliyah, D. A., Prasetiyo, B., Muzayanah, R., & Lestari, A. D. (2024). Optimizing customer segmentation in online retail transactions through the implementation of the K-means clustering algorithm. Scientific Journal of Informatics, 11(2). https://doi.org/10.15294/sji.v11i2.6137
Chehreh, S., & Sarabadani, A. (2024). A model based on random forest algorithm and Jaya optimization to predict bank customer churn. Journal of Engineering Management and Soft Computing, 9(2), 132–148. https://doi.org/10.22091/jemsc.2024.9541.1174
Chen, D., Sain, S. L., & Guo, K. (2012). Data mining for the online retail industry: A case study of RFM model-based customer segmentation using data mining. Journal of Database Marketing & Customer Strategy Management, 19(3), 197–208. https://doi.org/10.1057/dbm.2012.17
Fayyad, U., Piatetsky-Shapiro, G., & Smyth, P. (1996). From data mining to knowledge discovery in databases. AI Magazine, 17(3), 37–54. https://doi.org/10.1609/aimag.v17i3.1230
Han, J., Kamber, M., & Pei, J. (2022). Data mining: Concepts and techniques (4th ed.). Morgan Kaufmann.
Imanuel, D. A., & Alfian, G. (2025). Visualisasi segmentasi pelanggan berdasarkan atribut RFM menggunakan algoritma K-means untuk memahami karakteristik pelanggan pada toko retail online. Jurnal Teknologi Informasi dan Ilmu Komputer, 12(5). https://doi.org/10.25126/jtiik.2025128619
John, J. M., Shobayo, O., & Ogunleye, B. (2024). An exploration of clustering algorithms for customer segmentation in the UK retail market. arXiv. https://arxiv.org/abs/2402.04103
Johnson, J., Tellis, G. J., & Ip, E. H. (2013). To whom, when, and how much to discount? A constrained optimization of customized temporal discounts. Journal of Retailing, 89(4), 361–373. https://doi.org/10.1016/j.jretai.2013.08.002
Lemmens, A., & Gupta, S. (2020). Managing churn to maximize profits. Marketing Science, 39(5), 956–973. https://doi.org/10.1287/mksc.2020.1229
MacQueen, J. (1967). Some methods for classification and analysis of multivariate observations. In L. M. Le Cam & J. Neyman (Eds.), In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability (Vol. 1, pp. 281–297). University of California Press.
Miglautsch, J. R. (2000). Thoughts on RFM scoring. Journal of Database Marketing & Customer Strategy Management, 8(1), 67-72. https://doi.org/10.1057/palgrave.jdm.3240019
Ozcan, T. (2026). Customer segmentation using an extended RFM model and clustering algorithms in e-commerce. Journal of Theoretical and Applied Electronic Commerce Research, 21(5), 142. https://doi.org/10.3390/jtaer21050142
Salim, B. A., & Messaoud, C. (2026). Data-driven customer segmentation using the RFM model and K-means clustering: A longitudinal analytical study of online retail behavior using Python and Orange3. Science Education and Innovations in the Context of Modern Problems, 9(5). https://doi.org/10.56334/sei/9.5.17
Sarabada
Anitha, P., & Patil, M. M. (2022). RFM model for customer purchase behavior using K Means algorithm. Journal of King Saud University: Computer and Information Sciences, 34(5), 1785–1792. https://doi.org/10.1016/j.jksuci.2019.12.011
Athey, S., & Imbens, G. (2016). Recursive partitioning for heterogeneous causal effects. Proceedings of the National Academy of Sciences, 113(27), 7353–7360. https://doi.org/10.1073/pnas.1510489113
Awaliyah, D. A., Prasetiyo, B., Muzayanah, R., & Lestari, A. D. (2024). Optimizing customer segmentation in online retail transactions through the implementation of the K-means clustering algorithm. Scientific Journal of Informatics, 11(2). https://doi.org/10.15294/sji.v11i2.6137
Chehreh, S., & Sarabadani, A. (2024). A model based on random forest algorithm and Jaya optimization to predict bank customer churn. Journal of Engineering Management and Soft Computing, 9(2), 132–148. https://doi.org/10.22091/jemsc.2024.9541.1174
Chen, D., Sain, S. L., & Guo, K. (2012). Data mining for the online retail industry: A case study of RFM model-based customer segmentation using data mining. Journal of Database Marketing & Customer Strategy Management, 19(3), 197–208. https://doi.org/10.1057/dbm.2012.17
Fayyad, U., Piatetsky-Shapiro, G., & Smyth, P. (1996). From data mining to knowledge discovery in databases. AI Magazine, 17(3), 37–54. https://doi.org/10.1609/aimag.v17i3.1230
Han, J., Kamber, M., & Pei, J. (2022). Data mining: Concepts and techniques (4th ed.). Morgan Kaufmann.
Imanuel, D. A., & Alfian, G. (2025). Visualisasi segmentasi pelanggan berdasarkan atribut RFM menggunakan algoritma K-means untuk memahami karakteristik pelanggan pada toko retail online. Jurnal Teknologi Informasi dan Ilmu Komputer, 12(5). https://doi.org/10.25126/jtiik.2025128619
John, J. M., Shobayo, O., & Ogunleye, B. (2024). An exploration of clustering algorithms for customer segmentation in the UK retail market. arXiv. https://arxiv.org/abs/2402.04103
Johnson, J., Tellis, G. J., & Ip, E. H. (2013). To whom, when, and how much to discount? A constrained optimization of customized temporal discounts. Journal of Retailing, 89(4), 361–373. https://doi.org/10.1016/j.jretai.2013.08.002
Lemmens, A., & Gupta, S. (2020). Managing churn to maximize profits. Marketing Science, 39(5), 956–973. https://doi.org/10.1287/mksc.2020.1229
MacQueen, J. (1967). Some methods for classification and analysis of multivariate observations. In L. M. Le Cam & J. Neyman (Eds.), In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability (Vol. 1, pp. 281–297). University of California Press.
Miglautsch, J. R. (2000). Thoughts on RFM scoring. Journal of Database Marketing & Customer Strategy Management, 8(1), 67-72. https://doi.org/10.1057/palgrave.jdm.3240019
Ozcan, T. (2026). Customer segmentation using an extended RFM model and clustering algorithms in e-commerce. Journal of Theoretical and Applied Electronic Commerce Research, 21(5), 142. https://doi.org/10.3390/jtaer21050142
Salim, B. A., & Messaoud, C. (2026). Data-driven customer segmentation using the RFM model and K-means clustering: A longitudinal analytical study of online retail behavior using Python and Orange3. Science Education and Innovations in the Context of Modern Problems, 9(5). https://doi.org/10.56334/sei/9.5.17
Sarabadani, A., Saffarie, M., & RahseparFard, K. (2023). A framework for automating e-government services based on artificial intelligence. Journal of Engineering Management and Soft Computing, 9(2), 106-118. https://doi.org/10.22091/jemsc.2024.9256.1171
Wager, S., & Athey, S. (2018). Estimation and inference of heterogeneous treatment effects using random forests. Journal of the American Statistical Association, 113(523), 1228-1242. https://doi.org/10.1080/01621459.2017.1319839
Jafari, M., Akbari, A. H., & Akhavan, P. (2026). Leveraging Generative AI to Drive Supply Chain Resilience and Sustainable Performance: A Mediation Framework for Next-Generation Supply Chains. Technology in Society, 103444. doi: 10.1016/j.techsoc.2026.103444
Jafari, M., Akhavan, P., & Akbari, A. H. (2026). A Data-Driven Multi-Objective optimization framework for dynamic job shop scheduling with order Acceptance, inventory and Energy-Aware decisions. Computers & Industrial Engineering, 111886. doi: 10.1016/j.cie.2026.111886
Jafari, M., & Akbari, A. H. (2026). Deep reinforcement learning for dynamic cellular manufacturing systems with deterioration effect. International Journal of Computing Science and Mathematics, 23(1), 39-80. https://doi.org/10.1504/IJCSM.2026.151974
Jafari, M., & Akbari, A. H. (2026). Efficient algorithms for cellular manufacturing systems with deterioration effect and inventory (case study: stone paper factory). International Journal of Industrial and Systems Engineering, 52(3), 345-383. https://doi.org/10.1504/IJISE.2026.152157
Jafari, M., Akhavan, P., & Akbari, A. H. (2026). Enhancing supply chain agility and performance through big data analytics: the role of digitalization and top management support. International Journal of Productivity and Performance Management, 1-22. https://doi.org/10.1108/IJPPM-06-2025-0557
ni, A., Saffarie, M., & RahseparFard, K. (2023). A framework for automating e-government services based on artificial intelligence. Journal of Engineering Management and Soft Computing, 9(2), 106-118. https://doi.org/10.22091/jemsc.2024.9256.1171
Wager, S., & Athey, S. (2018). Estimation and inference of heterogeneous treatment effects using random forests. Journal of the American Statistical Association, 113(523), 1228-1242. https://doi.org/10.1080/01621459.2017.1319839