Abstract
Arterial oxygen saturation measured by co-oximetry (SaO2m) is the clinical reference for oxygenation, but in the mechanically ventilated patients studied here the freshest usable value is nine hours old. We build a virtual sensor that bridges this gap from continuously recorded ventilator and gas-rig time series with gradient-boosted trees, and report it as three nested implementation scenarios of one code base: X0 (XGBoost 2.1.4 through our pipeline, no physics term active), XP (X0 plus a blend toward the anchor and the cumulative oxygen uptake rate over the gap per kilogram of body mass, derived from an oxygen balance of the arterial blood) and v4 (XP plus a patient-level anchor that recalibrates the nine-hour-old measurement toward the patient’s own history). Out-of-fold predictions under patient-grouped five-fold cross-validation are scored on the 3730 hours of 30 patients whose inputs contain no SaO2m value younger than nine hours. From X0 to XP, the mean per-patient MAPE decreases slightly, from 3.321% to 3.289%, an effect resolved by a paired patient bootstrap for this summary only. From XP to v4, it decreases further to 3.117%, the pooled MAPE decreases from 3.890% to 3.727% (both changes resolved by the bootstrap), and the pooled correlation increases from 0.754 to 0.793. Meanwhile, the model becomes substantially smaller, with the number of input features decreasing from 55 to 19 and the number of tree leaves decreasing from 9527 to 450. An exact decomposition of every prediction shows that in v4 the two-coefficient anchor earns 81% of the improvement over persistence and carries nearly all of the prediction variance. All formulas are matched line by line to the C++ and Python sources.