pyreal.utils.explanation_utils.get_top_contributors#
- pyreal.utils.explanation_utils.get_top_contributors(explanation, num_features=5, select_by='absolute')[source]#
Extracts the top num_features most important or contributing features from a feature-based explanation.
- Parameters:
explanation (DataFrame with an Importance or Contribution column) – The explanation to extract from
num_features (int, optional) – Number of features to extract. Defaults to 5.
select_by (one of "absolute", "max", "min", optional) – If absolute, extract the highest importance/contribution by absolute value. In max/min, extract the highest/lowest features. Defaults to “absolute”.