Gluformer-tiny / README.md
njeffrie's picture
Create README.md
2f564ec verified
metadata
model-index:
  - name: Gluformer-tiny
    results:
      - task:
          type: glucose-prediction
        metrics:
          - name: RMSE
            type: 60 minute prediction
            value: 25.36
        source:
          name: Brown2019
          url: https://www.nejm.org/doi/full/10.1056/NEJMoa1907863

Model Card for Gluformer Blood Glucose Prediction Model

This model uses past continuous glucose monitor (CGM) values to predict values for the next hour.

Model Details

Model Description

  • Developed by: Renat Sergazinov, Mohammadreza Armandpour, Irina Gaynanova
  • Funded by: Texas A&M University
  • Shared by: Nat Jeffries
  • Model type: Time series encoder-decoder Transformer

Model Sources

How to Get Started with the Model

Use the code below to get started with the model.

from transformers import AutoModel, AutoConfig
from datetime import timedelta, datetime

model = AutoModel.from_pretrained('njeffrie/Gluformer-tiny', trust_remote_code=True)
config = AutoConfig.from_pretrained('njeffrie/Gluformer-tiny', trust_remote_code=True)

# Dummy input and timestamp values.
input_glucose = [100.0 for _ in range(config.len_seq)]
timestamps = [datetime(2025, 7, 25, 0, 0) + timedelta(minutes=5 * i) for i in range(len(input_glucose))]
subject_id = 0

pred, log_var = model(subject_id, timestamps, input_glucose)

Predictions will be predicted future glucose values in 5 minute increments. Log var indicates confidence. See the paper for more details.