An importance score indicates how relevant an input feature is to an outlier detector’s score. Global importance summarizes relevance across records; local importance identifies features relevant to one record. Both help answer a question that an outlier label alone cannot: which measurements deserve closer inspection? section 13.2.1
For a fitted detector, SHAP can estimate importances from the original feature columns. A global bar plot ranks features across the data, while a beeswarm plot also shows whether low or high values tend to contribute more to outlier scores. Selecting one explanation produces a local plot for that record. In PyOD, IForest offers detector-level importances; ECOD and COPOD offer record-level views of exceptional feature values. section 13.2.1 section 6.15
Listing 13.2 Determining the SHAP global feature importances
import shap
df = df.sort_values('IF Score') #1
explainer = shap.Explainer(det) #2
explanation = explainer(df[orig_features])
The SHAP workflow passes a detector to Explainer, then evaluates it on the original feature columns. Sorting by outlier score puts the highest-scored record first for a subsequent local plot. section 13.2.1
Reading an abalone explanation
For an anomalous abalone record, high importance for whole weight and diameter directs attention to those measurements. It does not establish whether each value is unusual on its own or whether their combination is unusual. Across the dataset, SHAP and PyOD can rank features differently: PyOD’s IForest importances are more approximate and, in this example, gave numeric features nearly identical scores. section 13.2.5 section 13.2.1
Interpret importance in light of the detector. For univariate detectors such as ECOD and COPOD, exceptional values may explain much of a score. BHAD sums univariate tests and supplies both local and global importances; its feature-level results can account for its score because it does not detect unusual combinations. For detectors sensitive to interactions or internal outliers, importance alone is a partial explanation. Understand what the features mean, inspect scores rather than labels alone, and use complementary explanations—such as proxy models or counterfactuals—when the feature ranking leaves the score unclear. section 13.2.1 section 13.3.2 section 13.2.5





