# A Framework and Benchmarking Study for Counterfactual Generating Methods on Tabular Data
## 1 Introduction  
Machine learning algorithms are becoming ever more common in our daily lives [1]. One of the reasons for this widespread application is the high prediction accuracy those methods can achieve. However, this gain in predictive accuracy comes at a cost of increased complexity of the prediction models and in a resulting lack of interpretability [2]. The inability to explain why certain predictions are made can have a drastic impact on the adoption of automated decision-making in society, as people are often reluctant to use such complex models, even if they are known to improve the predictive performance [3, 4, 5, 6, 7, 8, 9]. Furthermore, these models may hide unfair biases that discriminate against sensitive groups [10, 11, 12, 13]. These problems can be even more critical when models are constantly created and updated, as often observed in real-time applications [14]. To solve this deficiency, multiple strategies are proposed in a research domain commonly referred to as 'eXplainable AI' (XAI) [15], aimed at unveiling the high complexity of the models obtained through machine learning methodologies as deep neural networks [16, 17], ensemble methods [18, 19], and support vector machines [20]. They also have vast application in various fields, including finance [21, 22], medicine [23, 24], and self-driving cars [25, 26]. The XAI methodologies are diverse, and can roughly be categorized according to the model that provides the explanation, the type of data, the scope of explanation, and general objective [15]. First, in terms of model type, explainability can be derived from intrinsically comprehensible models [27, 28], and common examples are decision trees andlinear regression. However, complex models ironically require additional post-hoc methodologies to obtain explanations. These can be designed for specific types of models [18; 29] or be model agnostic [27; 30]. In terms of data type, explanations naturally vary across different variations of data. For example, images often use a group of pixels to identify image patterns or features [31], while the explanations for tabular data decisions are mostly described in feature value combinations [32]. Analyzing the scope of the explanations [15]: these can be global, trying to explain how the model works over the complete dataset, or local, where a single point prediction is explained. Finally, the explanation objectives can be diverse [33], depending on the objective of the application (model improvement, bias detection, decision justification, and others) and role of the user receiving the explanation (manager, data scientist, end user) [34]. One particular explanation methodology of interest is the counterfactual explanation [34; 35], which generates local explanations, but has diverse implementation settings as they can be model specific, model agnostic, work with different types of data, and serve several objectives. Counterfactual explanations have a long history, even beyond that of XAI, with roots in both psychology and philosophy [36; 37; 35]. According to [PERSON] [38] counterfactual explanations answer the question _\"Why P rather than Q?\"_. The outcomes P and Q are termed fact and foil, respectively, where the former is the event that occurred (in this article referred to as factual), and the foil is the alternate case that did not occur (called counterfactual here). Several studies indicate the advantages of counterfactual explanations [13; 39], as they can make algorithmic decisions more understandable for humans [35]. Additionally, the recent legal requirements for the use of machine learning in decision-making process, such as those asked in GDPR, can also be fulfilled with counterfactual explanations [40].