CODEX: Journal of Software Engineering
Vol 1, No 2 (2026): June 2026

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

Firza Septian (Universitas Serelo Lahat)
Yusi Nurmala Sari (Universitas Serelo Lahat)
Nina Dwi Putriani (Universitas Serelo Lahat)



Article Info

Publish Date
29 Jun 2026

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

Copyrights © 2026






Journal Info

Abbrev

CODEX

Publisher

Subject

Description

CODEX: Journal of Software Engineering is a peer-reviewed scientific journal dedicated to the dissemination of high-quality research, theoretical studies, and technological innovations in the field of software engineering. The journal focuses on advancing knowledge and best practices in software ...