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) combined with ARIMA and XGBoost

Your CSV must include at least these columns:

glucose_col = Glucose value (target)

TimeSeries = time series data

Timestamp_col = Timestamp data

subject ID

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.2.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.2-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: imputecgm-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 0c8d8b4c8e817b56cff86890808f41a62ba09224bce2279602d58a6fb98afdd0
MD5 8d45e27b4db0beff0f37d7d50509acc6
BLAKE2b-256 e9cdce34224b082dc208fc6ca417dcedb67ba336ebcf75be80050eb440b44bae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: imputecgm-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 81304475bf92f6b56a447f0f6a2f7a02c4cfc2699125610b4a2a330033f93dd0
MD5 4736317dc0b035b6297c6b7488017a7b
BLAKE2b-256 b1e787dfbf10a0f99c521c31f77359c6e3d3be389341028ec52005ba6e21222c

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