Class Cardinality as a Source of Prediction Uncertainty in E-Commerce Customer Analytics
Abstract
1. Introduction
2. Methodology
3. Results
3.1. Comparative Performance of Machine Learning Classifiers
3.2. Controlled Analysis of Class Cardinality Effects
3.3. Real-Variable Validation of Class Cardinality Effects
3.4. Impact of Class Imbalance and Statistical Significance Testing
4. Discussion
5. Business Implications
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Valencia-Arias, A.; Uribe-Bedoya, H.; González-Ruiz, J.D.; Santos, G.S.; Ramírez, E.C.; Rojas, E.M. Artificial intelligence and recommender systems in e-commerce. Trends and research agenda. Intell. Syst. Appl. 2024, 24, 200435. [Google Scholar] [CrossRef] [Scilit]
- Madanchian, M. The Role of Complex Systems in Predictive Analytics for E-Commerce Innovations in Business Management. Systems 2024, 12, 415. [Google Scholar] [CrossRef] [Scilit]
- Anthoniraj, S.; Kumar, A.N.; Hemakumar Reddy, G.; Raju, M. Classification of Imbalanced Data in E-Commerce. In International Conference on Smart and Sustainable Technologies in Energy and Power Sectors (SSTEPS); IEEE: Mahendragarh, India, 2022; pp. 204–209. [Google Scholar] [CrossRef] [Scilit]
- Chen, W.; Yang, K.; Yu, Z.; Shi, Y.; Philip Chen, C.L. A survey on imbalanced learning: Latest research, applications and future directions. Artif. Intell. Rev. 2024, 57, 137. [Google Scholar] [CrossRef] [Scilit]
- Suguna, R.; Suriya Prakash, J.; Aditya Pai, H.; Mahesh, T.R.; Vinoth Kumar, V.; Yimer, T.E. Mitigating class imbalance in churn prediction with ensemble methods and SMOTE. Sci. Rep. 2025, 15, 16256. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Wu, Z.; Jin, L.; Zhao, J.; Jing, L.; Chen, L. Research on Segmenting E-Commerce Customer through an Improved K-Medoids Clustering Algorithm. Comput. Intell. Neurosci. 2021, 2022, 9930613. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Cevahir, A.; Murakami, K. Large-scale Multi-class and Hierarchical Product Categorization for an E-commerce Giant. In Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers; The COLING 2016 Organizing Committee: Osaka, Japan, 2016; pp. 525–535. [Google Scholar]
- Guo, C.; Pleiss, G.; Sun, Y.; Weinberger, K.Q. On Calibration of Modern Neural Networks. arXiv 2017, arXiv:1706.04599. [Google Scholar] [CrossRef] [Scilit]
- Gawlikowski, J.; Tassi, C.R.N.; Ali, M.; Lee, J.; Humt, M.; Feng, J.; Kruspe, A.; Triebel, R.; Jung, P.; Roscher, R.; et al. A survey of uncertainty in deep neural networks. Artif. Intell. Rev. 2023, 56, 1513–1589. [Google Scholar] [CrossRef] [Scilit]
- Xu, F.; Pan, Z.; Xia, R. E-commerce product review sentiment classification based on a naïve Bayes continuous learning framework. Inf. Process. Manag. 2020, 57, 102221. [Google Scholar] [CrossRef] [Scilit]
- Deniz, E.; Erbay, H.; Coşar, M. Multi-Label Classification of E-Commerce Customer Reviews via Machine Learning. Axioms 2022, 11, 436. [Google Scholar] [CrossRef] [Scilit]
- Lei, B.; Wang, J.; Shen, C. Automatic classification method of e-commerce commodity raw materials through the introduction of self-supervised concepts and the construction of domain ontology. Sci. Rep. 2026, 16, 8058. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Micci-Barreca, D. A preprocessing scheme for high-cardinality categorical attributes in classification and prediction problems. ACM SIGKDD Explor. Newsl. 2001, 3, 27–32. [Google Scholar] [CrossRef] [Scilit]
- Jambeiro Filho, J.; Wainer, J. Using a Hierarchical Bayesian Model to Handle High Cardinality Attributes with Relevant Interactions in a Classification Problem. In Proceedings of the IJCAI’07: Proceedings of the 20th International Joint Conference on Artificial Intelligence, Hyderabad, India, 6–12 January 2007; pp. 2504–2509. Available online: https://dl.acm.org/doi/10.5555/1625275.1625679 (accessed on 23 May 2026).
- Pargent, F.; Pfisterer, F.; Thomas, J.; Bischl, B. Regularized target encoding outperforms traditional methods in supervised machine learning with high cardinality features. arXiv 2021, arXiv:2104.00629. [Google Scholar] [CrossRef] [Scilit]
- Sigrist, F. A Comparison of Machine Learning Methods for Data with High-Cardinality Categorical Variables. arXiv 2023, arXiv:2307.02071. [Google Scholar] [CrossRef] [Scilit]
- Fernández-Delgado, M.; Cernadas, E.; Barro, S.; Amorim, D. Do We Need Hundreds of Classifiers to Solve Real World Classification Problems? J. Mach. Learn. Res. 2014, 15, 3133–3181. [Google Scholar]
- Caruana, R.; Niculescu-Mizil, A. An Empirical Comparison of Supervised Learning Algorithms. In ICML ‘06: Proceedings of the 23rd International Conference on Machine Learning; Association for Computing Machinery: New York, NY, USA, 2026; pp. 161–168. [Google Scholar] [CrossRef] [Scilit]
- Au, T.C. Random Forests, Decision Trees, and Categorical Predictors: The “Absent Levels” Problem. arXiv 2017, arXiv:1706.03492. [Google Scholar] [CrossRef] [Scilit]
- Rodriguez, J.D.; Perez, A.; Lozano, J.A. Sensitivity Analysis of k-Fold Cross Validation in Prediction Error Estimation. IEEE Trans. Pattern Anal. Mach. Intell. 2010, 32, 569–575. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Abedin, T.; Xu, H.; Uddin, S. The impact of K selection in K-fold cross-validation on bias and variance in supervised learning models. Sci. Rep. 2026, 16, 6084. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Rainio, O.; Teuho, J.; Klén, R. Evaluation metrics and statistical tests for machine learning. Sci. Rep. 2024, 14, 6086. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Farhadpour, S.; Warner, T.A.; Maxwell, A.E. Selecting and Interpreting Multiclass Loss and Accuracy Assessment Metrics for Classifications with Class Imbalance: Guidance and Best Practices. Remote Sens. 2023, 16, 533. [Google Scholar] [CrossRef] [Scilit]
- Stern, H.S. Bayesian Statistics. In International Encyclopedia of the Social & Behavioral Sciences; Smelser, N.J., Baltes, P.B., Eds.; Pergamon: Oxford, UK, 2001; pp. 1052–1056. [Google Scholar] [CrossRef] [Scilit]
- Ramos, D.; Franco-Pedroso, J.; Lozano-Diez, A.; Gonzalez-Rodriguez, J. Deconstructing Cross-Entropy for Probabilistic Binary Classifiers. Entropy 2018, 20, 208. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Warren, E.M.; Handley, J.C.; Sheets, H.D. Cross entropy and log likelihood ratio cost as performance measures for multi-conclusion categorical outcomes scales. J. Forensic Sci. 2025, 70, 589–606. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Cleophas, T.J.; Zwinderman, A.H. Paired Continuous Data (Paired T-Test, Wilcoxon Signed Rank Test, 10 Patients). In SPSS for Starters and 2nd Levelers; Springer: Cham, Switzerland, 2016. [Google Scholar] [CrossRef] [Scilit]
- Bishop, C.M. Pattern Recognition and Machine Learning; Springer: New York, NY, USA, 2006. [Google Scholar]
- Cover, T.M.; Thomas, J.A. Elements of Information Theory, 2nd ed.; Wiley: Hoboken, NJ, USA, 2006. [Google Scholar] [CrossRef] [Scilit]
- Balasundaram, E.; Aranganathan, P.; Annavajjala, K.S.; Sivakumar, R.; Arumugam, M.; Vinoth, A. A Hybrid Approach for Customer Segmentation and Loyalty Prediction in E-Commerce. Prabandhan Indian J. Manag. 2024, 17, 56–69. [Google Scholar] [CrossRef] [Scilit]
- Zhang, J.; Qiu, Y.; Dong, L. Conformal deep forest for uncertainty-aware classification. J. King Saud Univ. Comput. Inf. Sci. 2025, 37, 155. [Google Scholar] [CrossRef] [Scilit]




| Category | Season | Size | |||
|---|---|---|---|---|---|
| Classes | Frequency | Classes | Frequency | Classes | Frequency |
| Accessories | 1240 (31.79%) | Fall | 975 (25.00%) | L | 1053 (27.00%) |
| Clothing | 1737 (44.54%) | Spring | 999 (25.62%) | M | 1755 (45.00%) |
| Footwear | 599 (15.36%) | Summer | 955 (24.49%) | S | 663 (17.00%) |
| Outerwear | 324 (8.31%) | Winter | 971 (24.90%) | XL | 429 (11.00%) |
| Payment Method | Shipping Type | Frequency of Purchases | |||
|---|---|---|---|---|---|
| Classes | Frequency | Classes | Frequency | Classes | Frequency |
| Bank Transfer | 612 (15.69%) | 2-Day Shipping | 627 (16.08%) | Annually | 572 (14.67%) |
| Cash | 670 (17.18%) | Express | 646 (16.56%) | Bi-Weekly | 547 (14.03%) |
| Credit Card | 671 (17.21%) | Free Shipping | 675 (17.31%) | Every 3 months | 584 (14.97%) |
| Debit Card | 636 (16.31%) | Next Day Air | 648 (16.62%) | Fortnightly | 542 (13.90%) |
| PayPal | 677 (17.36%) | Standard | 654 (16.77%) | Monthly | 553 (14.18%) |
| Venmo | 634 (16.26%) | Store Pickup | 650 (16.67%) | Quarterly | 563 (14.44%) |
| Weekly | 539 (13.82%) | ||||
| Category | Size | Season | |||||||
| Model | Accuracy | F1 score | Log loss | Accuracy | F1 score | Log loss | Accuracy | F1 score | Log loss |
| GNB | 0.4454 | 0.1540 | 1.2204 | 0.2531 | 0.2357 | 1.3868 | 0.4500 | 0.1551 | 1.2594 |
| LR | 0.4454 | 0.1540 | 36.0437 | 0.2613 | 0.2399 | 36.0437 | 0.4500 | 0.1551 | 36.0437 |
| DT | 0.3608 | 0.2346 | 8.7996 | 0.2559 | 0.2551 | 11.0777 | 0.3415 | 0.2391 | 9.2554 |
| RF | 0.3438 | 0.2386 | 3.8950 | 0.2592 | 0.2586 | 3.6113 | 0.3395 | 0.2617 | 3.6257 |
| SVM | 0.4454 | 0.1540 | 36.0437 | 0.2551 | 0.2497 | 36.0437 | 0.4500 | 0.1551 | 36.0437 |
| Payment Method | Shipping Type | Frequency of Purchase | |||||||
| Model | Accuracy | F1 score | Log loss | Accuracy | F1 score | Log loss | Accuracy | F1 score | Log loss |
| GNB | 0.1633 | 0.1208 | 1.7960 | 0.1690 | 0.1398 | 1.7948 | 0.1395 | 0.1030 | 1.9508 |
| LR | 0.1536 | 0.0974 | 36.0437 | 0.1669 | 0.1363 | 36.0437 | 0.1405 | 0.0967 | 36.0437 |
| DT | 0.1662 | 0.1653 | 16.0100 | 0.1692 | 0.1681 | 15.8230 | 0.1456 | 0.1439 | 17.4117 |
| RF | 0.1615 | 0.1609 | 7.1804 | 0.1649 | 0.1648 | 6.8832 | 0.1526 | 0.1522 | 9.0245 |
| SVM | 0.1608 | 0.1368 | 36.0437 | 0.1774 | 0.1707 | 36.0437 | 0.1467 | 0.1343 | 36.0437 |
| Number of Classes | Mean Confidence | Mean Entropy | Log Loss |
|---|---|---|---|
| 2 | 0.576442871 | 0.681177521 | 0.682370808 |
| 4 | 0.296332834 | 1.348275726 | 1.352318492 |
| 6 | 0.284825849 | 1.746593782 | 1.752378223 |
| 7 | 0.156502523 | 1.9436029 | 1.950618192 |
| Variable | Number of Classes | Mean Confidence | Mean Entropy | Log Loss |
|---|---|---|---|---|
| Category | 4 | 0.445714555 | 1.217489845 | 1.219867201 |
| Size | 4 | 0.271413979 | 1.383760718 | 1.387446215 |
| Season | 4 | 0.449923314 | 1.255456913 | 1.258927761 |
| Payment Method | 6 | 0.182427439 | 1.789578089 | 1.795229106 |
| Shipping Type | 6 | 0.182400476 | 1.789331466 | 1.793801015 |
| Frequency Purchases | 7 | 0.156502523 | 1.9436029 | 1.950618192 |
| Variable | Macro-F1 Score Original | Macro-F1 Score Balanced | Probability Variance Original | Probability Variance Balanced | Confusion Entropy Original | Confusion Entropy Balanced |
|---|---|---|---|---|---|---|
| Category | 0.154035241 | 0.293478374 | 0.000155742 | 0.000165245 | 1.217532035 | 1.382238689 |
| Frequency Purchases | 0.100641123 | 0.111198672 | 3.23 × 10−5 | 3.21 × 10−5 | 1.943562775 | 1.944018522 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Ghosh, I.; Sinha, M.; Mallick, P.; Poray, J.; Sarkar, S. Class Cardinality as a Source of Prediction Uncertainty in E-Commerce Customer Analytics. Analytics 2026, 5, 36. https://doi.org/10.3390/analytics5030036
Ghosh I, Sinha M, Mallick P, Poray J, Sarkar S. Class Cardinality as a Source of Prediction Uncertainty in E-Commerce Customer Analytics. Analytics. 2026; 5(3):36. https://doi.org/10.3390/analytics5030036
Chicago/Turabian StyleGhosh, Ishan, Mourani Sinha, Partho Mallick, Jayanta Poray, and Souvik Sarkar. 2026. "Class Cardinality as a Source of Prediction Uncertainty in E-Commerce Customer Analytics" Analytics 5, no. 3: 36. https://doi.org/10.3390/analytics5030036
APA StyleGhosh, I., Sinha, M., Mallick, P., Poray, J., & Sarkar, S. (2026). Class Cardinality as a Source of Prediction Uncertainty in E-Commerce Customer Analytics. Analytics, 5(3), 36. https://doi.org/10.3390/analytics5030036

