Efficient and Effective Counterfactual Explanations for Random Forests
Haifei Zhang, Jinfeng Zhong
Published in Expert Systems With Applications, 2025
https://doi.org/10.1016/j.eswa.2025.128661
Random forests are widely used in machine learning due to their excellent predictive performance and computational efficiency. However, their inherent complexity often hinders interpretability, making it challenging for users to understand the decision-making process. Explainable Artificial Intelligence (XAI) techniques aim to mitigate this issue by improving model transparency and providing explanations for predictions. Among these techniques, counterfactual explanations provide intuitive insights by describing the minimal modifications needed to achieve a desired outcome. However, generating counterfactual explanations of good quality is still challenging for random forests. In this paper, we propose a novel explanation approach called Efficient and Effective Counterfactual Explanation (EECE) for random forests, which generates counterfactual explanations by leveraging the structure of decision tree leaves. EECE not only ensures efficient explanation generation but also satisfies essential properties for high-quality counterfactual explanations, such as validity, proximity, sparsity, diversity, plausibility, and actionability. We compare EECE with existing methods across 15 datasets using multiple evaluation metrics, demonstrating its effectiveness in generating high-quality counterfactual explanations.
