Skip to content

notebook for imputation methods using PhysioNet2012 - #61

Open
sueoglu wants to merge 9 commits into
mainfrom
notebooks/issue-1061
Open

notebook for imputation methods using PhysioNet2012#61
sueoglu wants to merge 9 commits into
mainfrom
notebooks/issue-1061

Conversation

@sueoglu

@sueoglu sueoglu commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

fixes theislab/ehrapy#1061

  • Adds imputation_nb.ipynb, a new tutorial that walks through ehrapy's six imputation methods (explicit_impute, simple_impute, locf_impute, knn_impute, miss_forest_impute, mice_forest_impute) using the PhysioNet Challenge 2012 ICU dataset.
  • All methods are benchmarked on a 200-patient subset by masking 10% of observed values and comparing RMSE/MAE, mean/std deviation from ground truth, and runtime/memory cost (last one in progress)
  • Closes out with a decision guide (which method to pick based on variance sensitivity, speed needs, temporal structure, or cluster structure) and applies mice_forest_impute (we could also use locf) to the full dataset with before/after sanity checks.

side note: will see how to fix the rendering problem especially for the raincloud plots since its a little weird atm

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Comment thread imputation_nb.ipynb
Comment thread imputation_nb.ipynb
Comment thread imputation_nb.ipynb
Comment thread imputation_nb.ipynb
Comment thread imputation_nb.ipynb
@sueoglu
sueoglu requested a review from eroell August 4, 2026 15:02
@sueoglu
sueoglu marked this pull request as ready for review August 4, 2026 17:39
@review-notebook-app

review-notebook-app Bot commented Aug 4, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

eroell commented on 2026-08-04T17:39:20Z
----------------------------------------------------------------

no tem_data layer requried anymore


@review-notebook-app

review-notebook-app Bot commented Aug 4, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

eroell commented on 2026-08-04T17:39:21Z
----------------------------------------------------------------

Not "manageable", but better "quick for demonstration purposes"


@review-notebook-app

review-notebook-app Bot commented Aug 4, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

eroell commented on 2026-08-04T17:39:22Z
----------------------------------------------------------------

We use this masking strategy because real-world NaNs in the dataset have no ground truth, so direct accuracy evaluation on them is impossible.

This sentence can be completely deleted


@review-notebook-app

review-notebook-app Bot commented Aug 4, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

eroell commented on 2026-08-04T17:39:23Z
----------------------------------------------------------------

you can save the need for 2 lines of code if you instead do

edata_explicit = p.pp.explicit_impute(edata=edata_explicit, layer="tem_data", replacement=0, copy=True)

this reads a bit shorter. also for the others


@review-notebook-app

review-notebook-app Bot commented Aug 4, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

eroell commented on 2026-08-04T17:39:24Z
----------------------------------------------------------------

Avoid calling this three dimensions; three dimensions is already used above to describe the data shape.

Call it better "three aspects" or so


@review-notebook-app

review-notebook-app Bot commented Aug 4, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

eroell commented on 2026-08-04T17:39:25Z
----------------------------------------------------------------

You can add the reduce miss-forest already on this figure, just among the others - the notebook is quite comprehensive, and adding this here makes the information more condensed :)


@review-notebook-app

review-notebook-app Bot commented Aug 4, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

eroell commented on 2026-08-04T17:39:25Z
----------------------------------------------------------------

again, extra line for copy can be avoided with the copy=True argument


@review-notebook-app

review-notebook-app Bot commented Aug 4, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

eroell commented on 2026-08-04T17:39:26Z
----------------------------------------------------------------

Can we have a closing word afterwards? A small wrapup paragraph, just 2-3 sentences roughly, mentioning e.g. the textbook you refer to for a deeper discussion


…ctions 5.3.3 and 5.3.4 merged, closing section added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Notebook for imputation methods

2 participants