Enhancing counterfactual explanations with causal inference: integrating DirectLiNGAM and variational autoencoders for constraint-aware generation
摘要
This study introduces a novel framework that integrates causal information into counterfactual generation. Our method employs the Direct Linear Non-Gaussian Acyclic Model (DirectLiNGAM) to discover causal ordering among observed variables and construct a structured representation of their relationships. This causal representation is then incorporated into a Variational Autoencoder (VAE) by concatenating the causal error term, input features, and a negated outcome, alongside a newly designed loss function. These components jointly guide the VAE to generate counterfactuals that respect the inferred causal structure. To address challenges with categorical variables, we leverage target encoding in combination with the proposed loss function, enhancing robustness and applicability across diverse data types. Extensive experiments on synthetic and real-world datasets validate the versatility of our method and demonstrate its superior performance, particularly through improved Constraint Feasibility Scores on datasets with linear characteristics.