midlearn.MIDImportance

class midlearn.MIDImportance(estimator: MIDRegressor | MIDExplainer, **kwargs)[source]

MID Importance.

This object is returned by the MIDRegressor.importance() method and holds the results of the feature importance calculation.

__init__(estimator: MIDRegressor | MIDExplainer, **kwargs)[source]

Initialize the MIDImportance object.

Parameters:
  • estimator (MIDRegressor or MIDExplainer) – The fitted MID model instance from which to calculate importance.

  • **kwargs (dict) – Additional keyword arguments passed to the midr::mid.importance() function in R.

Methods

__init__(estimator, **kwargs)

Initialize the MIDImportance object.

plot([style, theme, terms, max_nterms])

Visualize the importance scores of the component functions from a fitted MID model with plotnine.

terms(**kwargs)

Extract term labels from the fitted model.

Attributes

importance

pd.DataFrame with the calculated importance values.

measure

The type of the importance measure used.

predictions

pd.DataFrame of the fitted or predicted MID values.