The Indonesian postal logistics sector continues to face challenges in maintaining letter delivery timeliness and Service Level Agreement (SLA) compliance under dynamic operational conditions. Conventional predictive approaches often rely on static representations and are limited in capturing temporal risk patterns in mail delivery processes. This study proposes a data-driven machine learning framework to predict delivery delay risk in postal letter services by integrating temporal feature engineering, class imbalance handling, and metaheuristic-based hyperparameter optimization. The framework applies the Synthetic Minority Over-sampling Technique (SMOTE) and evaluates multiple classification models using stratified cross-validation. Among the evaluated algorithms, XGBoost optimized using Particle Swarm Optimization (PSO) demonstrates the strongest predictive performance. The PSO-optimized configuration (n = 96, lr = 0.1718, d = 3) achieves an accuracy of 0.6605, ROC–AUC of 0.6883, and F1-score of 0.6059, indicating improved class-sensitive prediction. Model interpretability is examined using Mean Decrease in Impurity (MDI), which identifies posting day as the dominant contributor to delivery delays, followed by SLA commitment and intra-day posting patterns. The final framework generates probabilistic risk scores from 0 to 100 percent, with the highest observed value reaching 99.44, enabling early warning and prescriptive operational interventions for potential SLA violations. These results indicate that the proposed PSO–XGBoost framework supports proactive logistics risk management. However, this study is limited to historical data from a single postal operational environment and does not incorporate external factors such as weather, traffic, or regional delivery variations.
Copyrights © 2026