Abstract
Accurate forecasting of pharmaceutical demand is essential for maintaining the availability of medicines and minimizing waste in hospital supply systems. This study presents a hybrid Grey Wolf Optimized eXtreme Gradient Boosting (GWO–XGBoost) model designed to predict hospital-level medicine demand using real-world dispensing records and meteorological variables. The Grey Wolf Optimizer is applied to select the most informative predictors and fine-tune model parameters, improving the learning efficiency of the eXtreme Gradient Boosting algorithm. Weekly data from two provincial hospitals in Lamphun Province, Thailand were used to evaluate the model’s predictive capability. The proposed hybrid model was benchmarked against five machine-learning baseline models and evaluated using three standard performance metrics: Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), and the coefficient of determination ([Formula: see text]). By capturing the influence of temporal and environmental factors on medicine utilization, this model supports data-driven hospital planning and more reliable pharmaceutical supply management. The findings highlight the potential of optimization-based machine-learning methods to enhance forecasting performance in healthcare operations.