calculate_feature_importance_or_none#
- calculate_feature_importance_or_none(model: Any, dataset: Union[Dataset, DataFrame], model_classes, observed_classes, task_type, 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
- model_classes
possible classes output for model. None for regression tasks.
- observed_classes
Observed classes in the data. None for regression tasks.
- task_type
The task type of 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_)