midlearn.MIDConditional
- class midlearn.MIDConditional(estimator: MIDRegressor | MIDExplainer, variable: str, **kwargs)[source]
MID Conditional Expectations.
This object is returned by the MIDRegressor.conditional() method and contains data for plotting conditional dependence.
- __init__(estimator: MIDRegressor | MIDExplainer, variable: str, **kwargs)[source]
Initialize the MIDConditional object.
- Parameters:
estimator (MIDRegressor or MIDExplainer) – The fitted MID model instance to use.
variable (str) – The name of the feature for which to calculate conditional dependence.
**kwargs (dict) – Additional keyword arguments passed to the midr::mid.conditional() function in R.
Methods
__init__
(estimator, variable, **kwargs)Initialize the MIDConditional object.
plot
([style, theme, var_color, dots, reference])Visualize Individual Conditional Expectation (ICE) plots or Centered ICE (c-ICE) plots with plotnine.
terms
(**kwargs)Attributes
conditional
observed
values