Metadata-Version: 2.4
Name: imputeCGM
Version: 0.1.0
Summary: CGM missing glucose imputation with MICE, ARIMA, XGBoost, and optional GAIN-based methods
Author: Hasin Shad, Shubh Saraswat, Dr. Xiaohua Douglas Zhang
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: scikit-learn
Requires-Dist: statsmodels
Requires-Dist: xgboost
Requires-Dist: rpy2
Provides-Extra: gain
Requires-Dist: tensorflow; extra == "gain"

# imputeCGM

`imputeCGM` is a Python package for imputing missing glucose values in continuous glucose monitoring (CGM) data.

The package supports:

- Automatic method selection: MICE+ARIMA when missingness is low and MICE+XGBoost when missingness is higher
- Forced MICE+ARIMA
- Forced MICE+XGBoost
- GAIN-only imputation
- GAIN+ARIMA
- GAIN+XGBoost

## Installation

For MICE, ARIMA, and XGBoost methods:

```bash
python -m pip install -e .
```

For GAIN-based methods, install the optional TensorFlow dependency:

```bash
python -m pip install -e .[gain]
```

## Python usage

```python
from imputeCGM import impute_cgm

out = impute_cgm(
    df,
    timestamp_col="timestamp",
    subjectid_col="subjectid",
    glucose_col="glucose_value",
    interval_minutes=5,
    time_gap_tolerance_minutes=3,
    model_method="auto",
)
```

Valid `model_method` values are:

```text
auto
mice_arima
mice_xgboost
gain
gain_arima
gain_xgboost
```

## CLI usage

```bash
imputeCGM --input ExampleData.csv --output ExampleData_imputed.csv --model-method auto
```
