# A Comparative Study of Two Rule-Based Explanation Methods for Diabetic Retinopathy Risk Assessment
## 3 Preliminaries
### Contextualised LORE for Fuzzy Attributes (C-LORE-F)
* **Goal Test**: We check, for each generated individual, if, according to the black box, it has the same label as the root, \(y\). If that is the case, we generate its neighbours in the same way (i.e., applying one positive/negative change in the value of a single attribute). Otherwise, we have found an individual close to \(x\) that belongs to another class; thus, we have reached a boundary of \(y\), and we terminate the search from that instance. * **Path Cost**: The path cost of each example is calculated by measuring the HVDM distance between the generated example and \(x\). Hence, the generation of the closest neighbours of an instance \(x\) is a tree search procedure. The search process starts from this instance, and the available actions to move from one instance to another are applied. For each feature \(f\), the number of possible actions can be zero (\(f\) is Fixed), one (either next if the feature is temporally increasing or prev if it is temporally decreasing) or both, if \(f\) is variable. Each action only changes the value of one feature. The candidate node to be expanded, \(n\), is the one closest to \(x\), based on the path cost. If the outcome of the black-box model for the instance in \(n\) is different from \(y\), then it is a leaf of the tree. Otherwise, we expand that node. Consequently, for each node in the second level, we would have changes in two attributes or double changes in the same attribute, and so on. The expanding process terminates when we reach a predefined max-level, or when there are no more nodes to be expanded (all the leaves have led to changes in the initial classification). Repeated instances are ignored to avoid cycles. The expanding process is done by cloning the instance of the node to be expanded and applying the next and/or prev actions. After that, we pass the obtained instance to the black-box model \(b\) to obtain its corresponding label. To apply the actions step and prev for a given attribute we consider some separate zones based on its fuzzy sets, which are defined as shown in Figure 1, taking into account the intersection point between two consecutive fuzzy sets and the intervals of maximum activation. In Figure 1 the zones would be 0-5, 5-10, 10-15, 15-20, 20-25, 25-40, 40-50, 50-60, 60-75, 75-90 and 90-100. Given the value of the attribute, we locate its zone, and then we take the middle of the previous zone as the lower neighbour (the result of the prev action), and the middle of the next zone as the upper neighbour (the result of the next action). Figure 1 shows an example. The input value is 22, which belongs to the zone 20-25. Thus, the middle of the previous zone is the lower neighbour, \((15+20)/2=17.5\), and the middle of the next zone is the upper neighbour, \((25+40)/2=32.5\). We might end up applying only either the next action, if the located zone was the first one, or the prev action, if it was the last one. As soon as we obtain the neighbours \(\mathcal{D}\), we use the _YaDT_ system [27], an implementation of the C4.5 classification algorithm with multi-way splits of categorical attributes, to build the decision tree. Finally, from the tree we can extract a set of decision rules, one for each branch in the tree. The rules obtained are conjunctive and use inequality conditions that check if a certain numerical input value \(v_{j}\) for attribute \(f_{j}\) is above or below a threshold. In case of categorical attributes, the condition is an equality. So, rules have the following format:  
\[IF\ f_{i}\ op\ t_{i}\ [\text{AND}f_{j}\ op\ t_{j}\ \ldots\ [\text{AND}\ f_{z}\ op\ t_{z}]]\ \text{THEN}\ y\ =\ y_{k}\]  
Here, \(f_{i}\), \(f_{j}\) and \(f_{z}\) are attributes, \(op\) is the logical condition and can be either \(\leq\) or \(>\) if the attribute is continuous, and \(=\) if it is categorical, and \(t_{i}\), \(t_{j}\) and \(t_{z}\) are thresholds. Figure 1: Illustration of the next and prev actions.