OPTIMIZING XGBOOST FOR CUSTOMER CHURNPREDICTION IN E-COMMERCE USINGGRIDSEARCHCV AND STRATIFIEDCROSS VALIDATION
Customer churn prediction is important for e-commercecompanies because identifying customers who are likely toleave can help companies develop more targeted retentionstrategies. This study compares baseline and optimizedXGBoost models for customer churn prediction usingGridSearchCV and Stratified Five-Fold Cross-Validation.The experiment used an e-commerce churn datasetcontaining 5,630 customer records, 18 predictor variables,and one binary target variable. Data preprocessingincluded median imputation, Min-Max scaling fornumerical features, Ordinal Encoding for categoricalfeatures, and removal of the CustomerID identifier. The datawere divided into training and testing sets using an 80:20stratified split. For model optimization, preprocessing,SMOTE, and XGBoost were integrated into a pipeline, with SMOTE applied only to the training portion of each cross-validation fold. GridSearchCV evaluated 216 hyperparameter combinations, with the best configurationachieving a mean cross-validation F1-Score of 0.8747 ±0.0155. On the independent test set, the baseline modelachieved 99.11% Accuracy, 97.37% Precision, 97.37%Recall, 97.37% F1-Score, and 99.92% ROC-AUC, while theoptimized model achieved 98.85% Accuracy, 97.84%Precision, 95.26% Recall, 96.53% F1-Score, and 99.74%ROC-AUC. The optimized model slightly improvedPrecision but did not outperform the baseline on the otherevaluation metrics. These findings show thathyperparameter optimization does not necessarily improveoverall test-set performance and should therefore beassessed using an independent test set.
Authors
- Dwi Hartanti
- Sri Lestari
- Dyah Purwaningsih
- Aprilisa Arum Sari
Publication Details
- Journal
- Proceeding of International Conference on Science Health And Technology
- Published
- 2026-11-02
- DOI
- https://doi.org/10.47701/m609h512
- Primary Topic
- Customer churn and segmentation
- Type
- article
- Field-Weighted Citation Impact
- 0.00