Optimization of Random Forest for Outpatient Cancellation Prediction Using PSO and Behavioral Feature Engineering
Downloads
Outpatient cancellations and no-shows, defined respectively as proactive withdrawals and silent attendance failures, were consolidated into a binary target variable representing failed appointments that result in a completed visit. This issue significantly reduces healthcare efficiency and increases operational costs. While machine learning is widely applied, the existing methods face critical trade-offs between computational resource demands and data integrity, often relying on synthetic resampling such as SMOTE that introduces artificial noise. This study further aims to develop an optimized, lightweight Decision Support System designed as a core engine for potential future Hospital Digital Twin and AI Command Center architectures. The primary contribution is Behavioral Feature Engineering utilizing a 12-month retrospective patient history as a natural data enrichment strategy, offering a robust alternative to artificial data generation. The proposed framework employs an optimized Random Forest classifier combined with Target Encoding, Mutual Information-based feature selection, and Particle Swarm Optimization for hyperparameter tuning. To ensure computational efficiency, the optimization was performed on a stratified 2% sample of 10,690 records from a large-scale dataset containing 686,387 records from three hospitals. The final model achieved an accuracy of 0.871, an F1-score of 0.870, and a ROC-AUC of 0.940, effectively surpassing recent 2024 state-of-the-art benchmarks even under significant class imbalance. Furthermore, Particle Swarm Optimization achieved a 75.6% reduction in tree complexity, requiring only 122 estimators instead of 500, while preserving peak performance. Multi-scheme validation under strict chronological temporal splits and patient-grouped cross-validation proved high generalization stability, yielding robust F1-scores of 0.855 and 0.867, with a narrow 95% confidence interval of [0.8692, 0.8728]. The entire end-to-end pipeline was completed in under 60 minutes using standard CPU resources. In conclusion, the proposed framework provides a robust and sustainable predictive engine suitable for proactive clinical resource management and future hospital digital integration
Copyright (c) 2026 Azmi Abiyyu Dzaky , Farrikh Alzami, Pujiono Pujiono (Author)

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution-ShareAlikel 4.0 International (CC BY-SA 4.0) that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).





