calculate_feature_importance_or_none#
- calculate_feature_importance_or_none(model: Any, dataset: Union[Dataset, DataFrame], force_permutation: bool = False, permutation_kwargs: Optional[Dict[str, Any]] = None) Tuple[Optional[Series], Optional[str]] [source]#
Calculate features effect on the label or None if the input is incorrect.
- Parameters
- modelt.Any
a fitted model
- datasett.Union[‘tabular.Dataset’, pd.DataFrame]
dataset used to fit the model
- force_permutationbool , default: False
force permutation importance calculation
- permutation_kwargst.Optional[t.Dict[str, t.Any]] , default: None
kwargs for permutation importance calculation
- Returns
- feature_importance, calculation_typet.Tuple[t.Optional[pd.Series], str]]
features importance normalized to 0-1 indexed by feature names, or None if the input is incorrect Tuple of the features importance and the calculation type (types: permutation_importance, feature_importances_, coef_)