Show HN: I have trained 15 blood glucose forecasting models on my own data
A developer with Type 1 Diabetes trained and evaluated 15 blood glucose forecasting models, finding that a custom micro-transformer with LoRA and classical XGBoost perform best.
read it Provides a rigorous empirical comparison of custom, classical, and foundation models for blood glucose forecasting, complete with architecture details and benchmark tables.
summary
A developer built a zoo of 15 blood glucose forecasting models—ranging from classical baselines and XGBoost to a custom 31k-parameter transformer and foundation models—evaluated on personal data and the MetaboNet benchmark. To overcome data scarcity, the model was pretrained on 1M simulated traces and fine-tuned using a tiny 3,771-parameter LoRA adapter. Results show that XGBoost and LightGBM edge out on raw RMSE, but the fine-tuned micro-transformer catches more low-glucose events and reacts earlier. The entire pipeline runs locally on an Android phone via custom tooling.
key points
- XGBoost and LightGBM achieve the lowest RMSE on personal data (22.4 at 60 min), closely followed by the custom D16 DILATE transformer with LoRA (22.8).
- Pretraining a 31k-parameter transformer on synthetic data and fine-tuning with a tiny LoRA adapter (3,771 params) drastically improves performance over zero-shot models.
- While gradient-boosted trees win on overall error, the transformer detects significantly more hypoglycemic events and provides an earlier reaction time.
- All models, including custom apps and a local mobile execution runtime, are open-sourced on GitHub.
who should read it
Machine learning engineers, quantitative hobbyists, and developers interested in time-series forecasting or personalized health tech.
discussion warm
consensus
Participants express strong admiration for the technical depth and rigorous methodology of an N=1 DIY medical forecasting project, with several diabetics sharing similar tracking experiences.
pushback
A minority suggestion to use a strict ketogenic diet to avoid forecasting entirely received pushback regarding the practical challenges of managing Type 1 Diabetes.
Looks like gradient boosted trees did really well! XGBoost and LightGBM took the top two spots on average error, doing better than the more computationally expensive transformer models.
They did weaker on low-glucose detection, which is pretty bad in this particular case. But it's possible that's fixable by tweaking the loss function to care more about detecting low glucose. As far as I can tell, there's no structural reason the transformer model did better on low glucose, probably just that it was pretrained on a synthetic dataset that had more lows than the author's data.
I love gradient …
Breaks down why gradient-boosted trees excel at tabular forecasting while noting how synthetic pretraining helped the transformer catch dangerous low-glucose events.
Generated by an LLM from the article and thread. Check the sources before relying on it.