BiomedSciAI / causallib

A Python package for modular causal inference analysis and model evaluations
Apache License 2.0
728 stars 97 forks source link

Imbalanced covariates metrics and sklearn scorer wrapper #59

Closed ehudkr closed 1 year ago

ehudkr commented 1 year ago

Some additions and fixes:

  1. Add a weight-model metric counting the number (or fraction) of imbalanced features.
  2. Add a propensity-model scorer wrapping arbitrary scikit-learn metrics. This is added to contrib because the implementation does not align with current (sklearn-inspired) scorer implementation, as the sklearn scorer can be arbitrary and passed into the scorer class - required user to initialize the scorer as opposed to already-initialized regular scorer.
  3. Add **kwargs to the metrics signature, this will align their signature which will allow more generalized calls (more metric-agnostic calls).
  4. Add name for the time-variable in the survival NHEFS loader which went missing in the last refactor.