theislab / ehrapy

Electronic Health Record Analysis with Python.
https://ehrapy.readthedocs.io/
Apache License 2.0
232 stars 19 forks source link

Allow for normalization per covariate category #710

Closed eroell closed 6 months ago

eroell commented 6 months ago

Description of feature

We discuss the normalization bias in our bias notebook.

It can be of interest in some cases to normalize a variable not on the entire sample, but within specific subgroups:

For this, we should allow a variable batch_key to be passed with ehrapy's normalization functions, allowing for very concise control over per-batch normalization.

Towards bias mitigation, can be considerd part of #647