This study compares Random Forest and XGBoost for predicting impulsive buying among mobile marketplace users using historical data from 2022 and questionnaire data from 2026. The research stages include preprocessing, feature and target construction, stratified data splitting, class imbalance handling using SMOTE within a pipeline, and model evaluation using Accuracy, Precision, Recall, F1-Score, and Area Under the Curve (AUC). GridSearchCV with five-fold cross-validation was used for model selection, while SHAP was employed to interpret feature contributions to predictions. On the 2022 historical data, Random Forest achieved an F1-Score of 0.8129 and an AUC of 0.8260, outperforming XGBoost, which obtained an F1-Score of 0.7922 and an AUC of 0.7933. On the 2026 questionnaire data, both algorithms achieved an F1-Score of 0.9279, while Random Forest obtained an AUC of 0.8724 compared with 0.8432 for XGBoost. SHAP analysis identified Hedonic Browsing as the feature with the greatest predictive contribution in both datasets. Overall, Random Forest achieved a higher mean cross-validation F1-Score on both datasets.
Copyrights © 2026