strongio / foundry

MIT License
3 stars 0 forks source link

Add support for categorical `y` in `MarginalEffects` #24

Open andywong36 opened 1 year ago

andywong36 commented 1 year ago

Arises from the following snippet:

        if y is not None:
            X['_actual'] = y
            agg_kwargs['actual'] = ('_actual', y_aggfun)
            agg_kwargs['actual_lower'] = ('_actual', lambda s: s.quantile(.25, interpolation='lower'))
            agg_kwargs['actual_upper'] = ('_actual', lambda s: s.quantile(.75, interpolation='higher'))

.quantile is not a valid function on categorical y

andywong36 commented 1 year ago

This precipitates more questions.

  1. What would the marginal_effects plot look like for binary outputs?
  2. Does it even make sense to have marginal_effects support multi-class outputs?