Skip to content

dotXem/CG-EGA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CG-EGA Python Implementation

DOI

This is the implementation of the Continuous Glucose-Error Grid Analysis (CG-EGA) adapted to glucose prediction in Python. It follows the description of Kovatchev et al. [1]. It gives a measure of the clinical acceptability of the glucose predictions made by a model.

To cite, you can use:

@misc{debois2019CGEGA,
  author = {De Bois, Maxime},
  title = {CG-EGA Python Implementation},
  year = {2019},
  publisher = {GitHub},
  journal = {GitHub repository},
  note = {doi: \url{10.5281/zenodo.3459485}},
  url = {https://github.com/dotXem/CG-EGA}
}

Getting Started

Prerequisites

To run the CG-EGA, you will need the following Python 3.6 libraries

matplotlib 3.1.0
numpy 1.16.3
pandas 0.24.2

How to use

>>> from cg_ega import CG_EGA
>>> import pandas as pd
>>> freq = 5
>>> y_true, y_pred = np.load("example.npy")
>>> results = pd.DataFrame(data = np.c_[y_true.reshape(-1,1), y_pred.reshape(-1,1)], columns=["y_true","y_pred"])
>>> cg_ega = CG_EGA(results, freq)
>>> print("AP, BE, EP:", cg_ega.reduced())
AP, BE, EP: (0.8367346938775511, 0.12653061224489795, 0.036734693877551024)
>>> cg_ega.plot(day=0)

cg_ega

References

[1] Kovatchev, B. P., Gonder-Frederick, L. A., Cox, D. J., & Clarke, W. L. (2004). Evaluating the accuracy of continuous glucose-monitoring sensors: continuous glucose–error grid analysis illustrated by TheraSense Freestyle Navigator data. Diabetes Care, 27(8), 1922-192