## 2 Materials and Methods
### A Motivation Example
In conclusion, it becomes apparent that this simple example exposes the nonsense of trying to construct explanations without taking into account the semantics of the data. Continuing this issue, note that while it is easy to measure the accuracy of the model, there is no consensus on the quality measures of an explanation. Different metrics, e.g., fidelity, consistency, simplicity, generality, reliability, and causality, have been developed in order to assess explanation quality [31; 32]. If ML outputs align with intuitive human reasoning, users are more likely to trust and effectively interact with the system. A human-centric approach to explanation helps bridge the gap between complex ML algorithms and practical applications, ensuring that technology serves and aligns with human values and ethical standards. A model that performs well is generally considered more trustworthy than a model that performs poorly. However, the trustworthiness of a model goes far beyond its performance and depends on various factors. For this reason, it may be beneficial to explain less accurate models, as the explanation may help identify potential reasons for the poor performance and highlight areas that need improvement or may lead to the rejection of the model based on wrong assumptions. Nevertheless, the question of whether the explanation of a wrong model may be correct is still an open issue. Now, let us redefine the experiment using the same input data table but according to the enhanced and extended methodology focused on in this paper, i.e., model-driven XAI (MD-XAI). The core concept of the proposed MD-XAI approach involves integrating a knowledge component (KC). The KC comprises a set of definitions for (local) functional dependencies among the input variables (The notion of a functional dependency comes from the Relational databases). A variable (\(Y\)) is functionally dependent on variables \(X_{1},X_{2},\ldots,X_{n}\) if, given the values of \(X=[X_{1},X_{2},\ldots,X_{n}]\), the value of \(Y\) is uniquely determined. This relationship is represented as \(X\longrightarrow Y\). For obvious reasons, we only consider minimal functional dependencies, meaning that none of the \(X_{i}\) can be removed from \(X\) without losing the functional dependency. Domain experts can provide some of the functional dependencies, which may be either established knowledge in the field or hypothetical statements (thus, requiring validation). Such hypothetical functional dependencies can also be found with help of specialized algorithms; a good review of such algorithms for causal structure discovery is provided in [33]. When discovering functional dependencies in the data, one can generally look for the following:  
* Internal functional dependencies, i.e., among the variables naming the columns in the original set of input data;  
Figure 3: (**A**) LIME explanation and (**B**) SHAP explanation for a given prediction (green indicates positive contribution, while pink negative). * External functional dependencies, i.e., concerning the situation when a new, external variable is introduced, and it aggregates the knowledge represented by one or several original variables;
* Functional dependencies among the external variables, which can also be searched for, leading to a kind of multi-level scheme of dependencies [34]. Since variables \(a\), \(b\), and \(c\) are independent, no internal functional dependency exists among them (according to the knowledge provided by a domain expert). However, using expert knowledge, one can suggest introducing an external knowledge aggregation variable (\(d\)) such that \([a,b,c]\longrightarrow d\). The value of \(d\) is determined by the following formula defined by an expert: \(d=b^{2}-4 ac\). This slightly enigmatic example should now become clear. The initial example is rearranged by incorporating the KC. First, the input data table is completed. Table 3 presents the new, enriched dataset. The significance of parameter \(d\) is clear.