Proceeding of International Conference Health, Science And Technology (ICOHETECH)
2026: Proceeding of the 7th International Conference Health, Science And Technology (ICOHETECH)

OPTIMIZING XGBOOST FOR CUSTOMER CHURNPREDICTION IN E-COMMERCE USINGGRIDSEARCHCV AND STRATIFIEDCROSS VALIDATION

Dwi Hartanti (Universitas Duta Bangsa Surakarta)
Aprilisa Arum Sari (Universitas Duta Bangsa Surakarta)
Sri Lestari (Universitas Duta Bangsa Surakarta)
Dyah Purwaningsih (Universitas Duta Bangsa Surakarta)



Article Info

Publish Date
02 Nov 2026

Abstract

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.

Copyrights © 2026