Class imbalance in e-commerce customer behavior data caused classification models to be biased toward the non-purchase class and made accuracy misleading. This study aimed to build and evaluate a hybrid model that combined the Synthetic Minority Oversampling Technique (SMOTE) with Extreme Gradient Boosting (XGBoost) to predict customer purchase intention on the Online Shoppers Purchasing Intention Dataset, which contained 12,330 sessions of which only 15.47% ended in a purchase. The method comprised data quality auditing, one-hot encoding, an 80:20 stratified train-test split, and standardization and oversampling placed inside the pipeline to prevent data leakage. Hyperparameters were tuned separately for the baseline and hybrid models using randomized search with stratified 5-fold cross-validation, and seven metrics were used for evaluation. The proposed model was compared with Decision Tree, Random Forest, and Support Vector Machine. On the testing data, the hybrid model achieved the highest F1-Score (0.6625) and Recall (0.6963), whereas XGBoost without oversampling obtained the best Accuracy (0.9019), Matthews Correlation Coefficient (0.5983), auROC (0.9322), and auPR (0.7493). Oversampling raised Recall by 0.1073 but lowered Precision. The hybrid model was therefore more suitable when maximizing the detection of potential buyers was the main priority, although it was not superior on every metric.
Copyrights © 2026