BES-OPTIMIZED KNN FOR PURCHASE DECISION PREDICTION BASED ON SOCIAL MEDIA MARKETING AND WORD OF MOUTH QUALITY

DOI: https://doi.org/10.33650/codex.v1i2.15767
Authors

(1) * Firza Septian   (Universitas Serelo Lahat)  
        Indonesia
(2)  Yusi Nurmala Sari   (Universitas Serelo Lahat)  
        Indonesia
(3)  Nina Dwi Putriani   (Universitas Serelo Lahat)
(*) Corresponding Author

Abstract


This study proposes a Hybrid Machine Learning Framework for purchase decision analysis by integrating the Bald Eagle Search (BES) algorithm with the K-Nearest Neighbors (KNN) classifier. The dataset consists of 500 respondents collected through survey instruments, with Social Media Marketing (SMM) and Word of Mouth Quality (WQ) serving as predictor features, while Purchase Perception (PP) items are aggregated to form the target variable. The rapid growth of digital marketing and social media has made indicators such as SMM, which reflects consumer engagement with online marketing activities, and WQ, which captures the credibility of peer recommendations, critical in influencing consumer trust and purchase behavior. To capture these nonlinear relationships, the framework applies systematic data preparation, preprocessing with SMOTE balancing and standardization, and BES optimization to determine the optimal neighborhood size K for KNN. The dataset was split into training and testing subsets with an 80:20 ratio, resulting in 50 test samples used for evaluation each WOA-KNN and BES-KNN. The evaluation was conducted using accuracy, precision, recall, F1-score, and ROC curve analysis. Results show that the hybrid BES-KNN model achieved 96% accuracy, with precision, recall, and F1-score all at approximately 97.9%, indicating balanced and reliable classification performance; however, the moderate AUC value of 0.68 suggests that class imbalance and the distribution of prediction probabilities may have influenced discriminatory power, which explains the apparent inconsistency between high classification metrics and the ROC curve. This framework contributes to advancing machine learning applications in marketing analytics and provides a foundation for future research to refine feature selection and enhance discriminatory power



Keywords

: Bald Eagle Search, KNN, Purchase Decision Prediction, Social Media Marketing, Word of Mouth Quality



Full Text: PDF



References


Baskar, V. V., Sekar, S., Rajesh, K. S., Sendhilkumar, N. C., Thamizhamuthu, R., & Murugan, S. (2024). Cloud-based Decision Support Systems for Securing Farm-to-Table Traceability using IoT and KNN Algorithm. In 2nd International Conference on Intelligent Cyber Physical Systems and Internet of Things, ICoICI 2024 - Proceedings (pp. 443–448). https://doi.org/10.1109/ICoICI62503.2024.10696659

Dolega, L., Rowe, F., & Branagan, E. (2021). Going digital? The impact of social media marketing on retail website traffic, orders and sales. Journal of Retailing and Consumer Services, 60. https://doi.org/10.1016/j.jretconser.2021.102501

Firdaus, A. S. P. B., & Swarnawati, A. (2025). Social Media Marketing pada UMKM dengan Memanfaatkan E-Commerce. In Kajian Administrasi Publik dan ilmu Komunikasi (Vol. 2, Number 2, pp. 123–233). Asosiasi Seni Desain dan Komunikasi Visual Indonesia. https://doi.org/10.62383/kajian.v2i2.377

Huang, C., Zhang, W., Yang, B., Zheng, R., Sun, X., Chen, F., Xu, D., & Li, W. (2025). Noise Identification in Acoustic Emission (AE) Inspection of Oil Tank Bottom Corrosion Based on Multi-Domain Features and BES-SVM Algorithm. Processes, 13(10). https://doi.org/10.3390/pr13103291

Islam Ridoy, A. A., Ismail Siddique, M. A., & Joyti, O. (2024). A Machine Learning-Driven Crop Recommendation System with IoT Integration. In Proceedings - 6th International Conference on Electrical Engineering and Information and Communication Technology, ICEEICT 2024 (pp. 812–817). https://doi.org/10.1109/ICEEICT62016.2024.10534479

Jain, V., Wadhwani, K., & Eastman, J. K. (2024). Artificial intelligence consumer behavior: A hybrid review and research agenda. Journal of Consumer Behaviour, 23(2), 676–697. https://doi.org/10.1002/cb.2233

Lee, C. Y., & Zhuo, G. L. (2021). A hybrid whale optimization algorithm for global optimization. Mathematics, 9(13). https://doi.org/10.3390/math9131477

Machdani, M. D., & Kusuma, K. A. (2022). The Influence of Digital Marketing, Product Quality, and Price on Purchasing Decisions (UMKM Pawon Seafood Mojokerto): Pengaruh Digital Marketing, Kualitas …. In Archive.Umsida.Ac.Id (pp. 1–12). Universitas Muhammadiyah Sidoarjo. https://doi.org/10.21070/ups.3050

Meidiansyah, I., Bitrayoga, M., Zikry, A., & Septian, F. (2025). Penerapan KNN, DT, dan NB untuk Memprediksi Task Success Developer Berbasis AI-Metrics. BETRIK : Besemah Teknologi Informasi Dan Komputer, 16. https://doi.org/10.36050/rsvfdr22

Pratama, C. A., & Astarini, R. D. (2023). Electronic Word of Mouth as a Predictor of Purchase Intention: Evidence from Instagram and TikTok in Indonesia. International Journal of Digital Entrepreneurship and Business, 4(2). https://doi.org/10.52238/ideb.v4i2.119

Rahman, M. K., Hoque, M. N., Yusuf, S. N. S., Bin Yusoff, M. N. H., & Begum, F. (2023). Do customers’ perceptions of Islamic banking services predict satisfaction and word of mouth? Evidence from Islamic banks in Bangladesh. PLoS ONE, 18(1 January). https://doi.org/10.1371/journal.pone.0280108

Septian, F., & Meidiansyah, I. (2026). Septian, Firza. et.al (Bald Eagle Search Optimization for Feature Selection in Health Score Prediction Using Random Forest). JICTECH: Journal Innovation in Information and Computer Technology, 3(1), 31–41. https://doi.org/10.70895/jictech.v3i1.107

Someetheram, V., Marsani, M. F., Kasihmuddin, M. S. M., Jamaludin, S. Z. M., Mansor, M. A., & Zamri, N. E. (2025). Hybrid double ensemble empirical mode decomposition and K-Nearest Neighbors model with improved particle swarm optimization for water level forecasting. Alexandria Engineering Journal, 115, 423–433. https://doi.org/10.1016/j.aej.2024.12.035

Yahdin, S., Desiani, A., Andini, S. P., Cahyawati, D., Primartha, R., Arhami, M., & Arinda, D. F. (2022). COMBINATION OF KNN AND PARTICLE SWARM OPTIMIZATION (PSO) ON AIR QUALITY PREDICTION. Barekeng, 16(1), 7–14. https://doi.org/10.30598/barekengvol16iss1pp007-014


Dimensions, PlumX, and Google Scholar Metrics

10.33650/codex.v1i2.15767


Refbacks

  • There are currently no refbacks.


Copyright (c) 2026 Firza Septian, Yusi Nurmala Sari, Nina Dwi Putriani

Creative Commons License
 

CODEX: Journal of Software Engineering
Published by Lembaga Penerbitan, Penelitian dan Pengabdian kepada Masyarakat (LP3M) of Nurul Jadid University, Probolinggo, East Java, Indonesia.