<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Counterfactuals as Explanations for Monotonic Classifiers</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Sarathi K</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Shania Mitra</string-name>
          <email>shaniamitra9@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Deepak P</string-name>
          <email>deepaksp@acm.org</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sutanu Chakraborti</string-name>
          <email>sutanuc@cse.iitm.ac.in</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="editor">
          <string-name>XAI, Counterfactuals, Explanation, Case Based Reasoning, Monotonic Constraints</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Indian Institute of Technology Madras</institution>
          ,
          <addr-line>Chennai, 600036</addr-line>
          ,
          <country country="IN">India</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Queen's University Belfast</institution>
          ,
          <addr-line>University Rd, Belfast BT7 1NN</addr-line>
          ,
          <country country="UK">United Kingdom</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Recent advances in machine learning and in particular deep learning have led to models becoming increasingly complex and less interpretable. This has led to a surge in the field of explainable AI (XAI) which aims to understand and interpret predictions made by such models. One significant direction is that of generating counterfactuals that can help in providing rich causal explanations. In this work, we present a novel counterfactual generation algorithm, with an underlying monotonic constraint respecting classifier. The generated counterfactuals are realistic and the end-user can make changes to only a few features, allowing them to make amendments easily. We demonstrate the results of our algorithm and show how this technique can generate counterfactuals closer to the query with improved coverage, while incorporating domain knowledge in the form of monotonic constraints.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        In recent years, there have been quite a few interesting research papers reporting the applicability
of Case Based Reasoning (CBR) in facilitating better explanations [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ]. An important direction
in this regard is that of generating counterfactuals, which can help discover relationships
between the inputs fed to a machine learner and the prediction decision made by it. This is
especially useful for end users trying to understand how their current circumstances can be
improved to receive the desired outcome in the future. For instance, let us say, a user applies
for loan and a classifier rejects the loan (negative class). The simplest explanation that a CBR
system may generate is a “factual” one, in which the system just reports a case or a set of few
cases that were similar to the query, which had a similar outcome. A richer explanation takes
the form of a counterfactual that can reveal more actionable information: If you asked for a
slightly lower amount or your co-applicant income had been marginally higher, you would
have been granted the loan. Generating interesting counterfactuals that are actually useful for
∗Corresponding author.
http://member.acm.org/~deepaksp (D. P); http://www.cse.iitm.ac.in/~sutanuc/ (S. Chakraborti)
© 2022 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
the end user is a challenging problem, and this work attempts to identify and address certain
limitations of past research, and present fresh insights in this direction.
      </p>
      <p>
        In this paper, we assume a twin-system context [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] where predictions from a machine learning
(ML) or deep learning (DL) model have to be explained by a Case based Reasoner. In order to
generate counterfactuals, we exploit the fact that certain attributes in the cases are naturally
of the type More is Better (MIB) or Less is Better (LIB). This terminology was first introduced
by McSherry et al.[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. When buying a camera, a customer would typically prefer a model that
has high optical zoom and low price. Here, optical zoom is an MIB attribute and price is an
LIB attribute. In the context of generating counterfactuals in the loan domain, the chances of
a loan getting accepted are higher if the applicant income is high and the loan amount is low.
Thus, applicant income and loan amount are MIB and LIB attributes, respectively. We argue in
this paper that it is important for the predictive ML system to respect the monotonic nature of
attributes, in order to ensure that meaningful explanations are generated.
      </p>
      <p>The rest of the paper is organized as follows. In Section 2, we introduce notation and present
background information on counterfactual explanations. Section 3 investigates the current
approaches to generate counterfactual explanations and the problems they are plagued by.
Section 4 presents the formal approach and performance measures, and Section 5 elaborates
the data sets and experiment results. Finally, we draw conclusions and discuss future steps in
Section 6.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Background</title>
      <p>In this section, we introduce notation and provide background on counterfactual explanations.

Notation: We use a case base  containing  cases, each of which is a vector of features  ∈ ℝ
and label  ∈ {−1, +1} . We refer to the set of features in the case base 
as ℱ. Further,   is
used to index attribute  in case  . It is important to note that we assume the positive class to
be the desired outcome (e.g., loan application approved). Additionally, we also assume access
to a classifier  that allows the imposition of feature-wise monotonic constraints prior to the
training process.</p>
      <p>Counterfactual Explanations: Given a query  ∈ ℝ , belonging to the negative class,
counterfactual explanations return a case  ∈ ℝ that is close to  , by some pre-defined distance
measure, but is predicted to be positive by the classifier  .</p>
      <p>Nearest Like Neighbour: Given a query  , a case is called the nearest-like neighbour (NLN) if
it is the case closest to the  in the case base, belonging to the same class as  , i.e., the negative
class.</p>
      <p>Monotonic Constraints: Domain knowledge often dictates the way in which a feature should
influence the predictions of a classifier, in order for them to be plausible. These constraints
guided by domain knowledge can be of two types:
1. Increasing Constraint or MIB: Imposing the increasing constraint on a feature  ∈ ℱ
implies that increasing the value of   would lead to a greater probability of  belonging
to the positive class, i.e., the feature  is of type More is Better (MIB). Thus,
  ( 1,  2, … ,   , … ,  −1 ,   ) ≤   ( 1,  2, … ,   +  , … ,  −1 ,   )
where   (  ) gives the probability of case  belonging to the positive class and  ≥ 0 .
Thus, to get closest to the boundary of the two classes, we would need to find the lowest
possible value of   for which the predicted class is positive.
2. Decreasing Constraint or LIB: Imposing the decreasing constraint on a feature  ∈ ℱ
implies that increasing the value of   would lead to a lower probability of  belonging to
the positive class, i.e., the feature  is of type Less is Better (LIB). Thus,</p>
      <p>( 1,  2, … ,   , … ,  −1 ,   ) ≥   ( 1,  2, … ,   + , … ,  −1 ,   )
where  ≥ 0 and   (  ) is as defined above. To get closest to the boundary of the two
classes, we would need to find the greatest possible value of   for which the predicted
class is positive.</p>
      <p>Distance Function: To find the distance between  and  ′ with respect to a single, real-valued
or order-enumerated attribute  , we define feature distance  
as the absolute diference
between the two attribute values   and  ′ normalized by the diference between the maximum
and minimum values of the attribute in the case base.</p>
      <p>(  ,  ′ ) =</p>
      <p>|  −  ′ |
max − min
where,</p>
      <p>
        (  ,  ′ ) refers to the feature distance between  and  ′ for attribute  , max =
max (  ∀ ∈  ) and min = min (  ∀ ∈  ). Nominal attributes are handled in the usual
way [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. The search space for counterfactual explanations in ℝ is restricted in each of the 
dimensions by the minimum and maximum values of the corresponding attribute in the case
base. Since the goal of counterfactual explanations is to be as close as possible to the query,
looking beyond this region would prove to be wasteful. Due to this restriction on the dimensions,
the value of feature distance for every attribute is upper-bounded by 1 and lower-bounded
by 0, i.e., 0 ≤   (  ,  ′ ) ≤ 1 ∀ ∈ ℱ . On extending this measure to all features, we obtain a
combined feature distance which is equivalent to the Manhattan distance measure normalized
using min-max scaling.
      </p>
      <p>( ,  ′) = ∑</p>
      <p>|  −  ′ |
∈ℱ max − min
where,</p>
      <p>
        ( ,  ′) is the combined feature distance between  ,  ′ ∈ ℝ and ℱ is the set of features
in the case base such that |ℱ | =  . The closer the feature distance is to 0, the better the
counterfactual. Using the combined feature distance, we can define the similarity between two
instances  ,  ′ ∈ ℝ as,

( ,  ′) = 1 −
  ( ,  ′)

where  is the number of features in the case base. The similarity measure is also upper-bounded
by 1 and lower-bounded by 0. The closer the similarity is to 1, the better the counterfactual.
While accounting for varied ranges across features, the combined feature distance (and similarity)
produces sparse solutions and accurately depicts the absolute change that would have to be
made to the features of  to reach  ′ [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>Actionable Features: In order to maintain feasibility in the proposed counterfactual
explanations, often changes can be made only to a subset of features among the entire set ℱ. The
largest possible subset of MIB/LIB features  ⊆ ℱ , such that changes to any feature in  do not
afect feasibility of the solution, is called the set of actionable features. For instance, features
such as gender or nationality of a user cannot be modified in order to get a loan approved and
hence, these cannot be included in the set of actionable features.</p>
      <p>
        Diference and Match Features: The set of diference features ℒ [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] between two cases
 ,  ′ ∈ ℝ comprises the features whose feature distances are greater than or equal to some
arbitrary threshold  . The threshold can be set according to the needs of the application. This is
explained further in Section 4.1. The number of diference features ( |ℒ |) is given by   and the
maximum number of allowed diference features is given by  such that,   ≤  .
      </p>
      <p>Likewise, the set of match features ℒ consists of the features whose feature distances are
lower than the threshold  . The number of match features (|ℒ|) is given by   .
ℒ = { ∶  
( ,  ′) ≥ },
ℒ = ℱ − ℒ
⟹  =   +</p>
      <p>Given a query  and its corresponding counterfactual explanation  , the features that have to
be changed to go from  to  are given by ℒ.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Related Work</title>
      <p>
        Counterfactual generation algorithms involve exploration of the space around the query 
to discover points that are close to  but have a diferent class label. For this, a variety of
approaches have been proposed. These may be classified based on the search strategy, access
to training data and access to the machine learning model [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. The most commonly adopted
approaches make use of convex optimization methodologies or custom heuristic rules. Convex
optimization procedures need a diferentiable scoring function because they incorporate the
computation of gradients [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. However, these algorithms often need to solve the optimization
problem once for every generated counterfactual for each query, making it very expensive to
generate a set of diverse counterfactuals for every query. There are only a few approaches that
are able to generate a sizeable number of diverse counterfactuals, by some measure of diversity,
for each input query [
        <xref ref-type="bibr" rid="ref10 ref8 ref9">8, 9, 10</xref>
        ].
      </p>
      <p>
        Perturbation-based approaches attempt to meaningfully disturb the input until a point of the
opposite class is obtained [
        <xref ref-type="bibr" rid="ref11 ref9">9, 11</xref>
        ]. One challenge in such approaches is to contain the number
of counterfactuals that may be generated thereby – small increments in a numeric feature,
for example, can result in numerous counterfactuals, only a handful of which may truly be
worth considering. This problem of over-generation of potentially superfluous counterfactuals
is referred to as the problem of prolixity, and may be addressed, for instance, by restricting
attention to a case that is closest to the query case but has the opposite class label (the nearest
unlike neighbour). A second problem is that of sparsity, which relates to the requirement that the
generated counterfactual must make changes to the fewest possible features. A counterfactual
that makes changes to four or more features in the query may not be usable and is unlikely
to have substantial actionable information content. The third problem is that of ensuring
plausibility of the generated counterfactuals; in other words, the counterfactuals should not
suggest changes to feature values that are unrealistic, or those that violate underlying domain
constraints. Suggesting that doubling one’s salary or changing one’s gender would fetch her a
loan, for instance, is an example of an implausible counterfactual [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. A final challenge is that
of ensuring diversity – in other words, we need to generate multiple counterfactuals that are
suficiently diverse with respect to each other. This enhances the flexibility of the system in
terms of its ability to cater to a diverse set of users.
      </p>
      <p>
        In this work, we focus on enhancing the method proposed by Keane et al. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], henceforth
referred to as GCF (Good CounterFactual), which generates counterfactuals using a classical
CBR approach by reusing and revising the explanation cases close to the query.
      </p>
      <p>Additionally, we experiment with imposing monotonic-constraints on features such that the
MIB/LIB nature of the attribute is respected by the algorithm. Failure to take into account such
constraints frequently leads to implausible or counter-intuitive answers. The proposed approach
(henceforth referred to as MBC − Monotonic constrained Bound Corner counterfactuals)
generates a variety of counterfactuals by finding corners in the decision surface created by a
machine learning model across a subset of actionable attributes. The present work aims to
maintain sparsity, by strictly restricting the number of dimensions along which changes can be
made, while simultaneously improving upon diversity, by providing multiple diferent options
to the end user, and plausibility, by introducing domain-informed monotonic constraints at the
classifier-level.</p>
      <p>
        Working of the GCF Algorithm: In the GCF algorithm [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], the cases  and  ′ closest to the
query  and belonging to opposite classes are identified, where  and  belong to the negative
class while  ′ belongs to the positive class. The values of diference features of  and  ′ are
copied to  from  ′, i.e., ℒ, ′ = ℒ, ′. The values of the remaining features, i.e., the match
features, are copied from  onto counterfactual  , i.e.,   =   ∀ ∈ ℒ. Upon predicting the class
of  using the underlying ML model, if we obtain the desired positive class, counterfactual  ,
which is a combination of  and  ′, is output as the final result. If not, an additional adaptation
step is performed where the values of the diference features in  obtained from  are perturbed
until the desired class is obtained.
      </p>
    </sec>
    <sec id="sec-4">
      <title>4. Proposed Methodology</title>
      <p>The MBC algorithm uses corners in the decision surface of a monotonicity-respecting classifier
to identify the changes to be made to the query  in order to flip its class. In this section, we
formalize the approach used in this work.</p>
      <sec id="sec-4-1">
        <title>4.1. Approach</title>
        <p>
          The goal of counterfactual explanations is to return a case  ∈ ℝ close to the query  ∈ ℝ such
that the changes to be made to the features of  to flip its class label are minimal. In order to do
so, we take each of the possible pairs of cases in the case base (i.e., each of the (2) pairs) and
evaluate the feature distance  (  ,  ′ )∀ ∈  ∧ ∀,  ′ ∈  . If the feature distances of a pair,
for all except a maximum of three features, (depending on the number of allowed diference
features  ) are below a threshold known as tolerance level, the pair is added to a separate case
base known as the Explanation Case Base   [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ] and is referred to as an explanation case. If
the tolerance level is set to a low value, the number of explanation cases obtained is low, since
it is dificult to find cases that have the same or very close values for all except a maximum of
three features in the case base. If the tolerance level is set to a high value, however, the result
becomes unreliable since it is based on the argument that all else equal, only the diference
features contribute to the flip in class. However, if the match features vary widely, they may
contribute significantly to the decision made by the classifier. In this work, the tolerance is
chosen to be 2%. This value can be changed depending upon the requirement.
        </p>
        <p>However, even after allowing some tolerance while computing match features, the number
of explanation cases often turns out to be low due to cases in the case base being spread out in
space. In case the number of case pairs in   is less than 1% of the total number of possible pairs,
we eliminate features in order of increasing feature importance, such that the most important
features remain. The feature importance values are obtained from the underlying classifier  .
This procedure is repeated until we obtain at least 1% of the (2) possible pairs. The value of 1%
has been chosen arbitrarily and can be changed according to the requirement of the user. The
features in the set of eliminated features ℰ are no longer considered during the computation of
feature distance or similarity. Since the number of features under consideration reduces, the
number of features required to be matched, until the criteria for an explanation case is satisfied,
also reduces, i.e., ℒ + ℒ = ℱ − ℰ. This allows the number of explanation cases detected to
increase. When a query  is input, the explanation cases from   containing the nearest-like
neighbour are retrieved. Let the pairs be of the form (   ,    ) such that    belongs to
the negative class, and is the nearest like neighbour to  , while    belongs to the positive
class. The diference features of    and    are chosen to be the diference features of the
query  and the counterfactual  . This is done because the presence of the explanation case pair
(   ,    ) close to  tells us that by keeping the match features (approximately) constant and
varying only the diference features, we are able to flip the prediction of the classifier, implying
that the chosen diference features are able to influence the decision of the classifier, in turn,
indicating the existence of a counterfactual. Similar to the  algorithm, the values of the
match features are directly copied into the counterfactual vector  from the query  . However,
instead of copying the values of the diference-features from    to  , like in the  algorithm,
the   algorithm replaces the values with those of the corners in   -dimensional decision
surface of the classifier  . This decision surface could be visualized as one obtained when the
  diference feature dimensions are systematically varied and the output of the classifier  is
plotted at each point in this   -dimensional space.</p>
        <p>
          Ignoring the   match-feature dimensions, which are held constant throughout this
exploration, the   dimensional decision surface of the classifier  is monotonic in nature due to the
explicit MIB/LIB constraints the classifier  is met with. Although the present work is applicable
to diferent types of classifiers, it is of special significance in case of tree-based classifiers (such
as XGBoost [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ], used in this work), due to the axis-aligned nature of the decision surface [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]
produced which leads to the formations of corners (either 2D or 3D, depending on the value
of  ) on the decision boundary. Among these corners, the skyline corners [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ] are identified
as potential counterfactual candidates. Corners are chosen over other points in the decision
boundary as they are optimal in terms of the MIB/LIB constraints. For example, consider the
point  in Fig. 1. It is on the decision boundary, however, it is not at a corner. It can naturally
be seen that on moving along the Applicant Income direction until 
2 is reached, increasingly
better counterfactuals are obtained, since, Applicant Income, which is an MIB dimension, along
with distance to query reduce progressively. The same argument would apply to internal
corners, such as  due to which only skyline corners are seen as counterfactual candidates.
        </p>
        <p>To locate skyline corners at the boundary of the decision surface in ℝ  , a 2 × 2 grid in case of

 = 2 and a 2 × 2 × 2 grid in case of   = 3 is systematically slid across the   dimensions of the
search space. A skyline corner is said to be obtained when a single positive-class instance is
captured in one of the corners of the grid. The end-points of each dimension of the search space
are given by the maximum and minimum values of the corresponding attribute in the case base.
In addition to these corner counterfactuals having   ∈ {2, 3}, we also return counterfactuals in
every diference-feature dimension having</p>
        <p>= 1. For this, in each of the   dimensions, the
point in the boundary, lying on the axis, where the class flips is located using binary search
and output as a counterfactual. The top-5 counterfactuals, located using the aforementioned
procedure, closest to the query in terms of the normalized Manhattan distance (i.e., feature
distance) are returned as the output counterfactuals. This allows the user to choose convenient
dimensions to make changes or to trade-of between changes in multiple dimensions as per their
choice. This solves the diversity problem. As an example of the working of the method, in Fig.
1,</p>
        <p>1 is an example of a counterfactual located using binary search along the Applicant Income
dimension. Along the Co-applicant Income dimension, both end points of the search space have
a negative class label, hence, the search is abandoned, and no counterfactual is returned along
that dimension. Further,  2,  3 and  4 are the returned corner counterfactuals.</p>
      </sec>
      <sec id="sec-4-2">
        <title>4.2. Variants of the MBC and GCF Algorithms</title>
        <p>
          To demonstrate the performance of the MBC algorithm, it is compared to the GCF algorithm
using a variety of measures listed in Section 4.3. To test each algorithm, we consider 2 cases −
 = 2 and  = 3 . In case of  = 2 counterfactuals with   ∈ {1, 2} are returned while in case of
 2 ,  3 ,  −2 and  −3
of monotonic constraints on  .
 = 3 counterfactuals with   ∈ {1, 3} are returned. Some counterfactuals with   = 2 may also
be returned in case of  = 3 , depending on the number of diference features in the explanation
case closest to the query. We do not go beyond 3 diference features due to the human memory
constraints [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]. The algorithm, however, could easily be extended to higher dimensions. Each
of the two algorithms are subject to these two cases and are labelled as   2 ,   3 ,  2
and  3 respectively.
        </p>
        <p>Further, to demonstrate the importance of monotonic constraints experimentally, both the
algorithms, each having two variants, are evaluated with and without these constraints on the
underlying classifier  . It is important to note that the variant without the monotonic constraints
uses the same classifier as the one with constraints. The only diference is that, in one case, the
MIB/LIB constraints are not fed to the classifier prior to the training procedure, and thus, it can
learn any arbitrary decision surface. This, however, leads to counter-intuitive results, as we
will see in Section 4.3.</p>
        <p>Thus, all experiments are carried out on 4 variants of each of the two algorithms, namely,
, where X =   ,  and the subscript  refers to the use</p>
      </sec>
      <sec id="sec-4-3">
        <title>4.3. Importance of Monotonicity-respecting Classifier</title>
        <p>Most modern day classifiers, unless explicitly pre-programmed to do so, are unable to learn
monotonicity patterns in the attributes of the data. For example, if we consider the case of a
loan approval system, attributes such as applicant income are commonly known to be MIB,
while attributes such as loan amount are LIB, i.e., decreasing the loan amount increases the
chances of loan approval. In such a case the decision boundary of the classifier, unless fed with
monotonic constraints, often turns out to be counter-intuitive. For example, in Fig. 2 we observe
the decision boundary for a query for which applicant income and co-applicant income are
being varied. In both Fig. 2 (a) and (b) we observe that, for the same loan amount, as applicant
income increases from  1 to  2 , the loan which was rejected at  2 is approved at  2 since
 2 &gt;  1 . However, in the non-monotonic case (Fig. 2(a)) we can see that, all other features
being the same, for the same co-applicant income, a loan with applicant income  3 is rejected
but  2 is approved even though  3 &gt;  2 and all other features are held constant. This does
not match our expectation. Since the quality of counterfactuals produced greatly depends on
the classifier, it is very important that the classifier learns the general rules for loan application
acceptance rather than overfit itself to a small case base.</p>
      </sec>
      <sec id="sec-4-4">
        <title>4.4. Performance Measures</title>
        <p>In this section, we highlight the performance measures used to compare the variants of the
algorithms listed in Section 4.2. It must be noted that the   algorithm returns multiple
counterfactuals (up to 5) while the  algorithm returns only 1. To make the comparison fair,
all evaluation measures for the variants of   are calculated using the output counterfactual
 closest to the query  . The evaluation measures include similarity to query (  ) which
measures the similarity of the output counterfactual to the query and similarity to data (  )
measures the similarity of the output counterfactual to the nearest case. It is representative of
how close to real data the returned counterfactual is. Additionally, we also measure coverage,
which measures the proportion of queries for which the algorithm in question is able to provide
counterfactuals. A higher value of coverage is desired since it indicates that the algorithm is
able to provide counterfactuals to a larger number of queries. It is given by,
   =
∑∈
1, if  ℎ    
{
0 otherwise</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Results</title>
      <sec id="sec-5-1">
        <title>5.1. Loan Approval Data Set</title>
        <p>The Loan approval data set, consisting of 614 instances and 12 attributes, computes loan
eligibility based on customer details such as gender, marital status, education, loan amount,
credit history, applicant income, co-applicant income, etc. Among these, features such as gender,
marital status and education are excluded from the set of actionable features (even though
education could be an MIB feature) since the customer cannot alter these in order to get their
loan approved. Increasing constraints (MIB) are placed on features such applicant income and
co-applicant income, while features such as loan amount are subjected to decreasing constraints
(LIB). A counterfactual, in this case, would tell the loan applicant what measures to take to
get her loan approved. From Table 1, it can be seen that all variants of   outperform the
corresponding variants of  with respect to   and    . The top-performing  
variant -  − 2 , with respect to   ), outperforms the top-performing  variant
 − 2 by 5.7%. As expected,  variants have a higher similarity to data (  ) due
to their usage of actual feature values from the case base. However, the top-performing  
variant is only marginally. behind the top  variant in terms of   . The coverage of most
 -variants is seen to be very low, while the   variants fair better. The top   variant
has double the coverage as that of the top  variant. Additionally, we observe that each of
the variants with monotonic constraints, for both   and  outperform those without with
respect to each of the three measures, demonstrating the importance of these constraints in
the context of the given data set. Lastly, we observe that between the cases of  = 2 and  = 3 ,</p>
        <p>coverage and   increase as  increases, while 
 across all variants of both the algorithms.</p>
      </sec>
      <sec id="sec-5-2">
        <title>5.2. Wine Data Set</title>
        <p>The Wine data set consists of the chemical analysis of wines. It has 178 instances and 12
attributes such as content of Malic acid, ash, Flavonoids, colour intensity, hue, etc. There are
three class labels corresponding to the alcohol content. Since the   and  algorithms
deal with binary classification settings, the data set is converted to a binary classification case
base using the one-vs-all technique. A counterfactual, in this case, would tell the wine distillery
what changes to make to improve the alcohol content in the wine. Attributes such as Flavonoid
content, colour intensity and Malic acid content are assumed to have a decreasing constraint
(LIB) while hue is assumed to have an increasing constraint (MIB). Similar to the Loan data set
case in Section 5.1, we observe, from Table 2, that   outperforms  in terms of   and
coverage while  marginally outperforms   in terms of   . In this data set, however,
monotonic constraints do not add as much value as the previous one. For example, in   3 ,
similarity to data and query are seen to increase with the introduction of monotonic constraints,
while coverage decreases. In the case of   2 however, the addition of monotonic constraints
is seen to decrease similarity to data and query, while coverage remains constant. This can be
attributed to the lack of domain knowledge in the field, due to which some constraints may
have been formulated incorrectly.</p>
      </sec>
      <sec id="sec-5-3">
        <title>5.3. Employee Attrition Data Set</title>
        <p>The Employee Attrition data set consists of 1470 employee records with 34 attributes such
as gender, percentage of salary hike, job satisfaction, distance from home, monthly income,
overtime hours etc. These attributes are used to predict employee attrition - whether the
employee will leave the company or not. A counterfactual, in this case, would tell the company
what measures to take to prevent an employee from leaving. Features such as gender and
distance from home are excluded from the list of actionable attributes, since it is not possible for</p>
        <p>the company to change the gender of an employee. An increasing constraint (MIB) is placed on
features such as percentage of salary hike, job satisfaction, monthly income (for e.g. increasing
the salary of an employee would reduce the chances of him/her leaving) while, features such as
overtime hours are met with a decreasing constraint (LIB)(i.e., the lesser number of overtime
hours an employee is subject to the more likely he/she is to stay in the company). In Table
3, we observe trends similar to the previous two case studies. The   variants outperform
their corresponding  variants in terms of   and coverage, while  marginally
outperforms   in terms of   . Monotonic constraints are seen to improve similarity to
data in all cases except   −3 , while they improve similarity to query for all the variants.
Coverage is seen to be substantially higher among the   variants as compared to the 
variants. The   variants without constraints are seen to have a higher coverage than those
with the constraints.</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>6. Discussion</title>
      <p>
        In this work, we address the issues of prolixity, sparsity and plausibility raised by Keane et al.
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] as follows:
      </p>
      <p>
        Prolixity: Keane et al. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] suggests the use of methods that find the minimal changes to
the features of the test case that flip the prediction (i.e., the nearest unlike neighbour) to tackle
the problem of prolixity. However, in this study it is shown that to produce minimal changes
that flip the prediction, we do not need to rely on the nearest unlike neighbour. The present
algorithm produces points that are closer to the decision boundary, thus requiring lesser change.
      </p>
      <p>Diversity: In contrast to the  algorithm which returns only 1 counterfactual per query,
the   algorithm returns multiple counterfactuals per query, which make trade-ofs among
the diferent dimensions to reach the desired outcome. This presents the user with a diverse
choice of counterfactuals to choose from.</p>
      <p>
        Sparsity: Even though many algorithms claim to make changes to only a few features, many
of these counterfactuals may still involve relatively high numbers of feature-diferences (e.g.
&gt; 4) [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Since the present algorithm chooses and changes only between 1 and 3 features at a
time, it is possible to successfully deliver sparse counterfactuals.
      </p>
      <p>Plausibility: Finally, we address the problem of plausibility, which states that the
counterfactuals generated may not be valid cases in the domain, or they may suggest feature-changes
that are dificult-to-impossible. However, this concern stands invalidated in cases where the
attributes are known to be MIB or LIB. For an LIB or MIB attribute, every point between the
extremes is valid by definition, since the attributes are of monotonic nature. Further, to eradicate
the possibility of impossible values being returned, since we cap the values of each feature by
the corresponding minimum and maximum of the cases in the case base.</p>
    </sec>
    <sec id="sec-7">
      <title>7. Conclusion</title>
      <p>Majority of the present day counterfactual generation algorithms face the challenges of prolixity,
sparsity, plausibility and diversity among others. In this work, we explore skyline corners in
the decision boundary of a tree-based classifier, as counterfactuals. We also incorporate domain
knowledge by compelling the underlying classifier to respect monotonic constraints such
that the generated counterfactuals more plausible. Better counterfactuals are achieved with
this technique, in terms of similarity to query and coverage, while closely maintaining their
similarity to the existing cases. Although this is a unique way to find diverse counterfactuals,
monotonicity tends to be a subjective characteristic of each data set, and concrete domain
knowledge is required to represent such constraints. There is scope to find more eficient
processes to obtain counterfactuals in the monotonic feature space that could be explored in
the future.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>M. T.</given-names>
            <surname>Keane</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Smyth</surname>
          </string-name>
          ,
          <article-title>Good counterfactuals and where to find them: A case-based technique for generating counterfactuals for explainable ai (xai</article-title>
          ),
          <source>Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 12311 LNAI</source>
          (
          <year>2020</year>
          )
          <fpage>163</fpage>
          -
          <lpage>178</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>N.</given-names>
            <surname>Wiratunga</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Wijekoon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.</given-names>
            <surname>Nkisi-Orji</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Martin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Palihawadana</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Corsar</surname>
          </string-name>
          ,
          <article-title>Discern:discovering counterfactual explanations using relevance features from neighbourhoods (</article-title>
          <year>2021</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>D.</given-names>
            <surname>Mcsherry</surname>
          </string-name>
          ,
          <article-title>Similarity and compromise</article-title>
          ,
          <source>in: In Proceedings of the Fifth International Conference on Case-Based Reasoning</source>
          , Springer,
          <year>2003</year>
          , pp.
          <fpage>291</fpage>
          -
          <lpage>305</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>R.</given-names>
            <surname>Bergmann</surname>
          </string-name>
          , Experience Management: Foundations,
          <string-name>
            <given-names>Development</given-names>
            <surname>Methodology</surname>
          </string-name>
          , and
          <string-name>
            <surname>Internet-Based</surname>
            <given-names>Applications</given-names>
          </string-name>
          , Springer-Verlag, Berlin, Heidelberg,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>D.</given-names>
            <surname>Slack</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Hilgard</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Lakkaraju</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Singh</surname>
          </string-name>
          ,
          <article-title>Counterfactual explanations can be manipulated (</article-title>
          <year>2021</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>R. M. B. de Oliveira</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <string-name>
            <surname>Martens</surname>
          </string-name>
          ,
          <article-title>A framework and benchmarking study for counterfactual generating methods on tabular data</article-title>
          ,
          <source>Applied Sciences</source>
          <volume>11</volume>
          (
          <year>2021</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>I. Afonichkin,</surname>
          </string-name>
          <article-title>Explaining machine learning models by generating counterfactuals</article-title>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>S.</given-names>
            <surname>Dandl</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Molnar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Binder</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Bischl</surname>
          </string-name>
          , Multi-objective
          <source>counterfactual explanations, Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 12269 LNCS</source>
          (
          <year>2020</year>
          )
          <fpage>448</fpage>
          -
          <lpage>469</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>R.</given-names>
            <surname>Guidotti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Monreale</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Giannotti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Pedreschi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Ruggieri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Turini</surname>
          </string-name>
          ,
          <article-title>Factual and counterfactual explanations for black box decision making</article-title>
          ,
          <source>IEEE Intelligent Systems</source>
          <volume>34</volume>
          (
          <year>2019</year>
          )
          <fpage>14</fpage>
          -
          <lpage>23</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>A</surname>
          </string-name>
          .
          <string-name>
            <surname>-H. Karimi</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          <string-name>
            <surname>Barthe</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          <string-name>
            <surname>Balle</surname>
            ,
            <given-names>I. Valera</given-names>
          </string-name>
          ,
          <article-title>Model-agnostic counterfactual explanations for consequential decisions (</article-title>
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>B.</given-names>
            <surname>Mittelstadt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Russell</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Wachter</surname>
          </string-name>
          ,
          <article-title>Explaining explanations in ai</article-title>
          ,
          <source>FAT* 2019 - Proceedings of the 2019 Conference on Fairness, Accountability</source>
          , and
          <string-name>
            <surname>Transparency</surname>
          </string-name>
          (
          <year>2018</year>
          )
          <fpage>279</fpage>
          -
          <lpage>288</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>T.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Guestrin</surname>
          </string-name>
          ,
          <article-title>Xgboost: A scalable tree boosting system</article-title>
          ,
          <source>in: Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining</source>
          , KDD '16,
          <string-name>
            <surname>Association</surname>
          </string-name>
          for Computing Machinery, New York, NY, USA,
          <year>2016</year>
          , p.
          <fpage>785</fpage>
          -
          <lpage>794</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>A.</given-names>
            <surname>Criminisi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Shotton</surname>
          </string-name>
          , E. Konukoglu,
          <article-title>Decision forests: A unified framework for classification, regression, density estimation, manifold learning and semi-supervised learning</article-title>
          ,
          <source>Found. Trends. Comput. Graph. Vis</source>
          .
          <volume>7</volume>
          (
          <year>2012</year>
          )
          <fpage>81</fpage>
          -
          <lpage>227</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>S.</given-names>
            <surname>Börzsönyi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Kossmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Stocker</surname>
          </string-name>
          ,
          <article-title>The skyline operator</article-title>
          ,
          <source>in: Proceedings of the 17th International Conference on Data Engineering</source>
          , IEEE Computer Society, USA,
          <year>2001</year>
          , p.
          <fpage>421</fpage>
          -
          <lpage>430</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>