Optimizing Input Window Length and Feature Requirements for Machine Learning-Based Postprandial Hyperglycemia Prediction - Muhammad Rafly Alfarizqy Maulana; Fatma Indriani; Friska Abadi; Dwi Kartini; Muhammad Itqan Mazdadi (Department of Electromedical Engineering, POLTEKKES KEMENKES SURABAYA, 2026)
Continuous glucose monitoring systems currently generate alerts only after blood glucose thresholds are breached, limiting their utility for proactive diabetes management. Predicting postprandial glucose excursions before they occur requires determining the optimal amount of historical data and identifying which features contribute most to prediction accuracy. This study systematically evaluates how the length of the pre-meal observation window and feature composition affect machine-learning predictions of hyperglycemia events 60 minutes after eating. We analyzed 1,642 meal events from 45 adults wearing continuous glucose sensors, constructing features from pre-meal glucose trajectories, meal macronutrients, time of day, and health status. Four observation windows (15, 30, 45, 60 minutes) and three feature sets (all features, glucose-only, meal-only) were evaluated using Random Forest, XGBoost, and CatBoost with 5-fold group cross-validation. CatBoost with a 30-minute window achieved the best performance: 72.6% F1-macro, 79.6% accuracy, and 64.0% recall for hyperglycemia detection. Extending windows beyond 30 minutes did not yield consistent benefits, whereas 15-minute windows yielded comparable results. Glucose trajectory features alone retained 94% of full model performance (68.5% F1-macro), whereas meal composition alone proved insufficient (59.4% F1-macro). These findings demonstrate that recent glucose history dominates short-term prediction, enabling practical real-time systems with minimal data requirements. A 30-minute observation window with glucose and meal features offers an effective balance between prediction accuracy and system responsiveness.