Advanced level · Module 4: Explainable AI Techniques and Interpretability · Lesson 2 of 4
Pitfalls in Feature Importance
Learners investigate how correlated features, data leakage and impurity-based importances can mislead, and how to cross-check explanations.
In this lesson you will
- Identify misleading importance results
- Cross-check explanations with more than one method
Key concepts
impurity-based importancecorrelated featuresleakageexplanation disagreementcross-checking
The lesson
Impurity-based importances from tree models (feature_importances_) are biased towards features with many distinct values and are computed on training data. Permutation importance on a test set is usually more reliable, as scikit-learn's documentation explains.
Correlated features split or hide importance. If school type and county are related, either may appear important depending on chance. Group correlated features, or drop one and observe the change.
A feature with surprisingly high importance may signal leakage: information about the outcome that would not be available at decision time, such as 'attended remedial classes', which happened after the prediction date. Cross-check SHAP, permutation importance and domain knowledge, and investigate disagreements.
Step by step
- Compare impurity importance, permutation importance and mean absolute SHAP for the tree model.
- Identify any disagreements.
- Test one correlated pair by removing one feature and re-evaluating.
- Check every top feature for leakage by asking whether it is known at decision time.
Practice activity
Write an importance cross-check for the capstone model, explaining any disagreements and leakage risks.
Expected result: A reasoned cross-check that resolves or explains disagreements and confirms there is no leakage.
Check your understanding
-
Why can impurity-based importance mislead?
Show answer
It favours features with many distinct values and is based on training data.
-
What is a sign of possible leakage?
Show answer
A feature with surprisingly high importance that would not be known at decision time.
Further learning
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.