Skip to main content

MICE + Random Forest + KNN to handle missing values of CGM device

Project description

CGMissingData

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

MICE imputation (IterativeImputer)

Random Forest regression

KNN regression

It helps you test model performance under different missing-value rates.

Your CSV must include at least these columns:

LBORRES — glucose value (target)

TimeSeries — time series data

TimeDifferenceMinutes — time difference in minutes

USUBJID — subject ID

How to Run?

  1. Envirionment Setup- cd "C:\Path\To\Your\Project"

Create a virtual environment python -m venv .venv

Activate the environment ..venv\Scripts\activate

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

  2. 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:

..venv\Scripts\python.exe -c "from CGMmissingData 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)"

Using Google Colab? -!pip -q install CGMissingData==0.1.2 (change the version number depending our new release. You can also try with !pip -q install CGMissingData) -from CGMissingData 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)

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

cgmissingdata-0.1.4.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

cgmissingdata-0.1.4-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file cgmissingdata-0.1.4.tar.gz.

File metadata

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

File hashes

Hashes for cgmissingdata-0.1.4.tar.gz
Algorithm Hash digest
SHA256 1dd33d420286c81f94db3877f80044cc99d4e62b6c03575ca7708a7e969b8906
MD5 084e909c43b8bde28fcb00bf5a601424
BLAKE2b-256 bcf679457bf1d750b30754aa1f2e4d5d96a079a3ce3dc81a9420254be1354c26

See more details on using hashes here.

File details

Details for the file cgmissingdata-0.1.4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for cgmissingdata-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b00fc6c790e2defc325b288910a53dd94c5dec6da1d510c7f3b8d7f0e30f3929
MD5 23942ceafda5e63631e8651e3581865f
BLAKE2b-256 93c4c24bcd5a99dd57a53e4225aa149f95efb26148187c8d61ee7a6a8bc35068

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