Skip to main content

CGM missing glucose imputation with MICE, ARIMA, XGBoost, and optional GAIN-based methods

Project description

imputeCGM imputeCGM is a simple missing-data benchmarking package that runs:

MICE imputation (IterativeImputer)

ARIMA

XGBoost

Your CSV must include at least these columns:

Glucose value (target) = glucose_col

TimeSeries — time series data

Timestamp data= timestamp_col

subject ID = subjectid

How to Run?

Envirionment Setup- cd "C:\Path\To\Your\Project" Create a virtual environment python -m venv .venv

Activate the environment ..venv\Scripts\activate

Install python python -m pip install --upgrade pip pip install -e .

..venv\Scripts\python.exe -c "from imputeCGM import run_missingness_benchmark; r=run_missingness_benchmark('MyData.csv', mask_rates=[0.05, 0.10, 0.20, 0.30, 0.40]); print(r); r.to_csv('results.csv', index=False)" #Ensure your dataset (e.g., MyData.csv) is located in the project file. Execute the benchmark directly from the CLI to generate a results.csv file:

Using Google Colab?

!pip -q install imputeCGM==0.1.2 (change the version number depending our new release. You can also try with !pip -q install imputeCGM)

from imputeCGM import run_missingness_benchmark

df = "/content/drive/MyDrive/CGMExampleData.csv" # your dataset path

results = run_missingness_benchmark( "CGMExampleData.csv", # or df mask_rates=[0.05, 0.10, 0.20, 0.30, 0.40] )

print(results)

results.to_csv("results.csv", index=False)

imputeCGM CGM missing value imputation pipeline:

Convert timestamp to a numeric equal-interval TimeSeries using CGManalyzer::equalInterval.fn via rpy2 Add lag features per subjectid: lag1, lag2, lag3, rollmean Compute missing rate on glucose_value If missing rate <= 5%: MICE + ARIMA (segmentwise over missing blocks) Else: MICE + XGBoost Output original dataset plus imputed_glucose_value

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

imputecgm-0.1.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

imputecgm-0.1.1-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file imputecgm-0.1.1.tar.gz.

File metadata

  • Download URL: imputecgm-0.1.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for imputecgm-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d8284d1467a0d427e707bf34e0e974d3687aaccd01786a88a867b91fa72f5192
MD5 025ea22b2974ac2fc07567be83b7ce0d
BLAKE2b-256 889bd2ec9cb2539d8838127290e7ced08a879c1787229497264c7752f2b52002

See more details on using hashes here.

File details

Details for the file imputecgm-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: imputecgm-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for imputecgm-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 51d477be4fe512e613b536b19f95aaa008e7e57c733fc964f157a304e9231e3d
MD5 752570249ff5827a6b3c2c3996205f20
BLAKE2b-256 237987836081df68e3fe46c3fc332a7c1dc9d4801719b7e36c638a6eaf97f142

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page