<!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>Rule Extraction via Dynamic Discretization with an Application to Air Quality Modelling?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Dept. of Math.</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Wroclaw University of Environmental</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Life Sciences joanna.kaminska@upwr.edu.pl</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dept. of Math. and Comp. Sci., University of Ferrara</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Dept. of Math.</institution>
          ,
          <addr-line>Phy., and Comp. Sci.</addr-line>
          ,
          <institution>University of Parma</institution>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Dept. of Phy.</institution>
          ,
          <addr-line>Inf., and Math.</addr-line>
          ,
          <institution>University of Modena e Reggio Emilia</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>Association rule extraction is a very well-known and important problem in machine learning, and especially in the sub- eld of explainable machine learning. Association rules are naturally extracted from data sets with Boolean (or at least categorical) attributes. In order for rule extraction algorithms to be applicable to data sets with numerical attributes as well, data must be suitably discretized, and a great amount of work has been devoted to nding good discretization algorithms, taking into account that optimal discretization is a NP-hard problem. Motivated by a speci c application, in this paper we provide a novel discretization algorithm de ned as an (heuristic) optimization problem and solved by an evolutionary algorithm, and we test its performances against well-known available solutions, proving (experimentally) that we are able to extract more rules in a easier way.</p>
      </abstract>
      <kwd-group>
        <kwd>Association rule extraction • Optimization problem • Evolutionary algorithm</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Among the most relevant problems in machine learning there are classi cation
problem and association rule extraction problem. An association rule is an if-then
statement that helps to show the probability of certain relationship among the
attributes of a data set. While classi cation is a global problem (e.g., a
logistic regression model that classi es all instances), association rule extraction is
a local problem, that makes it possible for unusual, uncommon relationships to
emerge. The rst, and most successful, rule extraction algorithm is Agrawal and
Srikant's APRIORI [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], which is originally designed to extract, with a
deterministic approach, meaningful rules from a data set of Boolean attributes. APRIORI
has been later generalized to deal with numerical attributes (approaching, in a
sense, the discretization problem) in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], and to extract temporal rules (on a very
limited basis) in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. The quality of association rules is generally measured by
their support (that is, relevance within the data set) and their con dence (that is,
precision); depending on the particular application, though, other, more speci c
quality measures can be introduced.
      </p>
      <p>
        The approaches to the discretization (or binning) problem, or the problem
of mining quantitative association rules can be categorized into deterministic
(greedy), or non-deterministic (usually based on metaheuristics). Deterministic
static approaches simply cut the domain of a continuous attribute into a
predened number of bins before the mining process. Agrawal's solution to
discretization can be considered static. Indeed, it is built on a deterministic procedure
that partitions each quantitative attribute one-by-one (i.e., without considering
the distribution of the other attributes) into equal-width intervals, and on a
modi cation to the original APRIORI algorithm to handle sets of items that
are generalizations of others (e.g., saying that the age of someone varies in the
interval [20; 29] is more general than saying that it varies in the interval [20; 24])
and to take into account a newly introduced interestingness measure. Moreover,
adjacent intervals can be merged to compensate the low con dence of rules in
some cases. Discretization algorithms are available in some open-source learning
frameworks that belong to this category and allow both equal-width and
equalfrequency discretizations, but are separated from the rule learning phase, which
is applied to the resulting, discretized, data set: WEKA's discretization lter [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ],
Python's k-bins discretizer [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ], and R's discretization library [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ]. Deterministic
distance-based discretization is a possible alternative to static methods, and it
is based on clusterization; examples include [
        <xref ref-type="bibr" rid="ref13 ref15 ref21 ref4">4, 13, 15, 21</xref>
        ], among others.
Nondeterministic discretization, on the other hand, is based on designing an
optimization, multivariate problem [
        <xref ref-type="bibr" rid="ref14 ref20">14, 20</xref>
        ]: rules are extracted, and evaluated on a
discretized data set that is progressively modi ed; the main drawback of such an
approach is that the rule extraction algorithm must be re-designed. Finally, most
of the existing approaches are general purpose, but in many cases the intended
applications are represented by data sets with discrete numerical attributes (e.g.,
number of cars possessed, age, and so on); applying a discretization algorithm
for rule extraction from data sets with continuous attributes may require a more
specialized approach.
      </p>
      <p>
        In this paper we consider a data set that represents the measurement of
several air quality parameters on a speci c monitoring station in the center of
Wroclaw (Poland) during the interval of three years. Such a data set has been
studied in the context of global explanation models (e.g., in [
        <xref ref-type="bibr" rid="ref11 ref12">11, 12</xref>
        ]), with
interesting, but possibly incomplete, results; this is usually the case with real-world
data, on which one can often expect to be able to extract a general model
that leaves room to particular cases. In this paper we aim to extract
meaningful local rules, which may be useful to model the particular situations that
occurred during the measurement period. We propose and test a multivariate,
non-deterministic, distribution-based discretization algorithm that can be
coupled with a pre-existing rule extraction algorithm, such as APRIORI, and
implemented via an evolutionary algorithm. We prove that our solution produces more
rules w.r.t. the particular situations than those produced by the discretization
algorithms available in some open-source learning libraries. Finally, we prove
that, like most preprocessing task, optimal discretization is NP-hard, which
indicates that heuristic-based approaches, such as ours, are to be preferred; this
result, shown in the Appendix, is not necessary for the understanding of the rest
of the paper.
      </p>
      <p>The paper is organized as follows. Section 2 presents the needed preliminaries,
Section 3 formalizes the dynamic discretization process as an optimization
problem together with implementation details, Section 4 discusses the data and the
experimental setup, and, nally, Section 5 discusses the results of the proposed
method before concluding in Section 6.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Background</title>
      <p>
        Discretization. The discretization of the numerical attributes of a data set is a
preprocessing phase, much like feature selection or outlier detection.
Preprocessing approaches, which are designed to enable or improve a data mining process
on a data set, are classically separated into lters, wrappers, or embedded
algorithms. A lter, which is by large the most common type, is an algorithm that
uses statistical indicators to perform the preprocessing; it is independent from
the data mining or model extraction phase, which is applied to the resulting
data set. A wrapper is a combined approach, in which the result of the
preprocessing phase is continuously evaluated using the performances of a selected
data mining algorithm, in search of an optimal solution. Embedded algorithms
for preprocessing are integrated data mining algorithms, in which the
preprocessing is part of the mining process; by nature, embedded algorithms are more
di cult to implement, and therefore less common. The most relevant examples
of discretization lters are included in some open-source learning frameworks,
namely WEKA's discretization lter [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ], Python's k-bins discretizer [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ], and
R's discretization library [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ]; the di erences among them are mainly related to
their implementation, and they tend to behave in a very similar way. An
unsupervized discretization lter usually o ers two modalities, namely equal-width
bins (that is, bins in which the endpoints of the describing interval have all
the same distance), and equal-frequency bins (that is, bins that have roughly
the same number of instances). Attribute preprocessing algorithms, such as
discretization algorithms, can be also separated into univariate (in which attributes
are considered one-by-one) and multivariate (in which the decisions are taken
for subsets of attributes all together); the most common lters, as those
mentioned above, are all univariate. Among the proposed multivariate lters for
discretization, distance-based discretization has been studied in [
        <xref ref-type="bibr" rid="ref13 ref15 ref21 ref4">4, 13, 15, 21</xref>
        ],
among others. Since optimal preprocessing is usually a computational
unfeasible problem, the proposed deterministic solutions are generally sub-optimal
(greedy), and, sometimes, non-deterministic (i.e., heuristic-based) solutions are
advocated; however, lters are typically deterministic. In the current literature,
non-deterministic solutions for discretization are usually embedded algorithms,
in which, as we have recalled, the rule-extraction phase is re-designed to include
discretization, as in [
        <xref ref-type="bibr" rid="ref14 ref17 ref20 ref3">3, 14, 17, 20</xref>
        ]. Thus, summarizing, discretization lters are
mostly univariate and greedy, while embedded discretization algorithms require
the implementation of an ad-hoc rule extraction method.
      </p>
      <p>
        Multiobjective optimization. A multiobjective optimization problem (see,
e.g. [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]) can be formally de ned as the optimization problem of simultaneously
minimizing (or maximizing) a set of t arbitrary functions:
8 min = max f1(x)
&gt;
&gt;&lt; min = max f2(x)
      </p>
      <p>
        : : :
&gt;
&gt;: min = max ft(x);
(1)
where x is a vector of decision variables. A multiobjective optimization problem
can be continuous, in which we look for real values, or combinatorial, where we
look for objects from a countably (in) nite set, typically integers, permutations,
or graphs. Maximization and minimization problems can be reduced to each
other, so that it is su cient to consider one type only. A set F of solutions for a
multiobjective problem is non-dominated (or Pareto optimal ) if and only if for
each x 2 F , there exists no y 2 F such that (i) there exists i (1 i t) that
fi (y) improves over fi (x), and (ii) for every j, (1 j t, j 6= i), fj (x) does
not improve fi (y). In other words, a solution x dominates a solution y if and
only if x is better than y in at least one objective, and it is not worse than y in
the remaining objectives. We say that x is non-dominated if and only if there
is no other solution that dominates it. The set of non-dominated solutions from
F is called Pareto front. Optimization problems can be approached in several
ways; among them, multiobjective evolutionary algorithms are a popular choice
(see, e.g. [
        <xref ref-type="bibr" rid="ref10 ref16 ref9">9, 10, 16</xref>
        ]). Wrapper preprocessing algorithms can be easily de ned as
multiobjective optimization problems, as it is the case, for example, for feature
selection; in this paper we show how discretization for rule extraction can follow
the same pattern.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Dynamic Discretization</title>
      <p>
        Rule extraction. For a given categorical data set A, with categorical attributes
A = fA1; : : : ; Ang, an association rule is an object of the type:
: 1 ^ : : : ^ s ) s+1
where s &lt; n and i belongs to the domain of Ai, for each i. As de ned by
Agrawal and Srikant [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], a rule such as can be evaluated by its support, that
is, the fraction of the data set in which every instance is characterized by having
both 1; : : : ; s (antecedent) and s+1 (consequent), and its con dence, that is,
the ratio between the support and the subset of instances with 1; : : : ; s. So, the
greater the support the more in uential is the rule in the data set, and the greater
the con dence the greater is its precision; in general, we search for meaningful
rules (e.g., particular situations) with a high con dence. Discretizing a numerical
data set allows one to extract association rules from it, as it converts numerical
attributes into categorical ones. In the following, we refer to the categories of a
categorical attribute as labels.
      </p>
      <p>Binning. Given a numerical attribute, the rst step to dynamic discretization
is de ning a parametric function that returns the bins. Thus, let now A be a
numerical data set with attributes A = fA1; : : : ; Ang:</p>
      <p>2 a11 a12 : : : a1n 3
A = 664 a:2:1: a:2:2: :: :: :: a: 2: n: 757</p>
      <p>am1 am2 : : : amn
For a variable Ai, we denote by i its mean in A, and by i its standard deviation;
moreover, let ki 2 (0; 1] be a displacement parameter. For a given number li of
expected bins in which we want to discretize the domain of Ai, let i1; : : : ; ili be
the corresponding labels. Now, let v(Ai) be a certain value of the variable Ai;
by writing v(Ai) 2 ip we indicate that the interval/bin denoted by the label ip
includes the value v(Ai). Then, we set that v(Ai) 2 ip if:
&gt;8 v(Ai) &lt; i bli=2cki i
&gt;&gt;&lt;&gt; i (dli=2e p + 1)ki i v(Ai) &lt; i</p>
      <p>i ki i v(Ai) i + ki i
&gt;&gt;&gt; i + (p dli=2e)ki i &lt; v(Ai)
&gt;
: i + bli=2cki i &lt; v(Ai)</p>
      <p>i + (p
for an odd li, and if:
(dli=2e</p>
      <p>if p = 1
p)ki i if 1 &lt; p &lt; dli=2e</p>
      <p>if p = dli=2e
dli=2e + 1)ki i if dli=2e &lt; p &lt; li
if p = li
(2)
8&gt; v(Ai) i
&gt;&gt;&gt;&gt; i (li=2
&gt;&lt; i (li=2
&gt; i &lt; v(Ai)
&gt;&gt;&gt;&gt; i + (p li=2
&gt;: i + (p li=2
(li=2 p)ki i
p + 1)ki i &lt; v(Ai)
p + 1)ki i &lt; v(Ai)
i + (p li=2)ki i
1)ki i &lt; v(Ai)
1)ki i &lt; v(Ai)</p>
      <p>(li=2
i
i
i + (p</p>
      <p>if p = 1
p)ki i if 1 &lt; p &lt; li=2
if p = li=2
if p = li=2 + 1
li=2)ki i if li=2 + 1 &lt; p &lt; li
if p = li
(3)
for an even li. In Figure 1 (top) we graphically represented the transformation
for a given i; i; and ki, and for the odd case with li = 5. Intuitively, ki
represents how far an endpoint of a bin is from the mean ( i) in terms of standard
i
ki i
i
i + ki i
Optimization parameters:
ki 2 (0; 1] R displacement
li 2 [2; : : : ; maxLabels] N number of labels
deviations ( i). Applying it to the original numerical data set clearly leads to a
categorical one from which rules can be extracted:
For variables following the normal (Gaussian) distribution, this algorithm is
a simple generalization of the common equal-width binning (with a particular
con guration for li and ki); yet, as we shall see, for non-normally distributed
variables our technique often returns more signi cant bins.</p>
      <p>
        Binning as an optimization problem. Our purpose is to devise a good
discretization of a numerical data set using our distribution-based technique, that is,
to learn a good pair of values (ki; li), for each numerical attribute Ai. Following
the taxonomy that we have identi ed in Section 2, we design our
discretization algorithm as a wrapper, where APRIORI is used as a black-box. Because
of the nature of the classical implementation of APRIORI, support and con
dence must be set beforehand; therefore, optimizing these parameters may be
less meaningful. On the other hand, we are not just interested in precise rules,
but also in meaningful ones w.r.t. to speci c domain-application (e.g.,
particular situations). As pointed out in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], discretizing a numerical data set entails a
notion of interestingness. In particular, we claim that the less number of
categories, assuming that there are at least two categories per attribute, the more
interesting are the rules, because, to some extent, having less labels implies that
it is easier to interpret the discovered rules. Consistently with this observation,
let x = [(x11; x21); (x12; x22); : : : ; (x1n; x2n)] be a vector of decision variables, each one
of which is pair that represents the displacement ki and the number of bins li of
the attribute Ai (cfr. Figure 1, bottom). Let L(x) denote the collection of all lis
of a given vector x, and let M axbins(x) (resp., M eanbins(x)) be the maximum
value (resp., the average) in L(x). Also, let Card(x) (resp., M eanconf (x)) be the
number of rules (resp., the average con dence of the rules) that emerge from an
application of APRIORI over a numerical data set with n attributes discretized
using (2) and (3), for a given minimum support s and minimal con dence c. We
can instantiate (1) with four possible combinations of objectives:
aa
aa
mmianxMCaarxdb(ixn)s(x) (4)aa
aa
      </p>
      <p>mmianxMCaeradn(bxin)s(x) (5)aa
mmianxMMaexabnicnosn(fx)(x) (6)aa aa
mmianxMMeeaannbcionnsf(x(x)) (7)aa
Observe that minimizing the number of labels goes in favour of interpretable
rules, while having at least two (non-empty) labels per attribute goes in favour
of having meaningful rules.</p>
      <p>
        Implementation. Multiobjective evolutionary algorithms are known to be
particularly suitable to perform multiobjective optimization, as they search for
multiple optimal solutions in parallel. In this experiment we have chosen the
well-known NSGA-II (Non-dominated Sorted Genetic Algorithm) [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] algorithm,
which is available as open-source from the jMetal suite [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. NGSA-II is an
elitist Pareto-based multiobjective evolutionary algorithm that employs a strategy
with a binary tournament selection and a rank-crowding better function, where
the rank of an individual in a population is the non-domination level of the
individual in the whole population. As black-box rule extraction method we used
the class Apriori from WEKA. We have represented each solution with an array
of pairs:
      </p>
      <p>(k1; l1); (k2; l2); : : : ; (kn; ln)
in which, as in Figure 1 (bottom), 2 li maxLabels, where maxLabels is
a predetermined parameter, and ki 2 (0; 1]. The initial population is generated
randomly. Mutation and Crossover were slightly modi ed to take into account
the particular nature of our solutions. In particular, a mutation is performed,
randomly with the same probability, over the rst or the second component of
the chosen attribute; the displacement is either substituted by random element
in (0; 1] or incremented or subtracted by the value 0:1, while the number of
labels is either substituted by a random (integer) element in [2; maxLabels] or
incremented or subtracted by 1. Similarly, a crossover is performed at the level of
the pair (ki; li), that is, given two individuals to be crossed, two random pairs are
chosen for each one of them and cross-exchanged. This particular con guration
for performing both Mutation and Crossover is one among many others; the
systematic study of other con gurations is beyond the scope of this paper.</p>
      <p>Variable Unit
Air temp. (a) C
Solar dur. (d) h
Wind speed (w) ms 1
% Rel. hum. (r)
Air pressure (p) hP a
Tra c (t)
N O2
N Ox
4</p>
    </sec>
    <sec id="sec-4">
      <title>Data and Experimental Setup</title>
      <p>
        Data origin. There is only one communication station for measuring the air
quality in the city of Wroclaw, and it is located within a wide street with two
tra c lanes in each direction (GPS coordinates: 51.086390 North, 17.012076
East). The center of one of the largest intersections in the city with 14 tra c
lanes is located approximately 30 meters from the measuring station, and is
covered by tra c monitoring. The measurement station is located on the outskirts
of the city, at 9:6km from the airport. Pollution data are collected by the
Provincial Environment Protection Inspectorate and encompasses the hourly N O2 and
N Ox concentration values during full three years, from 2015 to 2017. Tra c data
are provided by the Tra c Public Transport Management Department of the
Roads and City Maintenance Board in Wroclaw, and include hourly count of all
types vehicles passing the intersection. Public meteorological data are provided
by the Institute of Meteorology and Water Management, and they include: air
temperature, solar duration, wind speed, relative humidity, and air pressure. In
order to have uniform data, solar duration values have been re-normalized in the
real interval [0; 1] (as standard). The full data set contains 26304 observations.
In the pre-processing phase, the instances with at least one missing value (617
samples, 2.3%) have been deleted. Some basic statistic indicators on the
remaining 25687 instances are presented in Table 1, along with the symbol used in the
tests for each variable. Unlike previous work in these data (e.g., in [
        <xref ref-type="bibr" rid="ref11 ref12">11, 12</xref>
        ]), we
are interested in extracting rules for particular cases, not satisfactorily explained
by a general regression model (e.g., sudden spikes in the contaminant
concentrations, or unexpectedly low values of the contaminant concentration in presence
of high values of the parameters that are linked to the common causes). In this
experiment, we have focused on N O2 values, eliminating the column N Ox from
the data set; that is, our interest are the rules whose consequent is N O2.
Experimental setup. We have performed one execution for each optimization
model (from (4) to (7)) with population size 100 and 1000 total evaluations; our
exploratory analysis showed that increasing the number of evaluations does not
contribute to improve the results. We have set APRIORI to extract a maximum
of 30 rules, with minimal support varying from 0.1 to 0.4 (with a 0.1 step) and
minimal con dence varying from 0.7 to 0.85 (with 0.05 step). Discovering at
most 30 rules is purely arbitrarily, and may a ect the outcome; nonetheless,
since one of our goals is to extract more rules, such parameter su ces when
increasing support and/or con dence. Moreover, observe that this choice depends
on our particular application, as we are interested in predicting and explaining
the amount of contaminant concentration (N O2). Being multiobjective, each
execution of a model gives rise to a Pareto front at the end of the last evolution
to which we applied a simple decision making criteria, that is, we selected the
best individual in terms of the second objective (number of rules in model (4)
and (5), average con dence of the rules in model (6) and (7)).
5
      </p>
    </sec>
    <sec id="sec-5">
      <title>Results and Discussion</title>
      <p>
        Results. In Table 2 and Table 3 we show the results of the execution of
optimization model (4) and (6). The results of model (5) (resp., (7)) are very similar
to those of model (4) (resp., (6)), and therefore are not shown. Model (4)
obviously extracts more rules than (6) in every con guration, given that we optimize
precisely the number of rules. In each line of both tables, we show: the
minimal support and con dence of rules with which APRIORI has been called; the
number of rules of the selected nal solution (more rules is better); the average
length of the rules (smaller rules is better for, e.g., interpretability); the average
con dence (more con dent rules is better); and a quality index that depends
on our particular application, that is, the number of rules whose consequent
is N O2 with highest values. In particular, we are interested in extracting rules
that may possibly explain sudden, and not necessarily common, high values of
the pollutant; yet, this parameter is merely informative, as not only depends on
the application, but, also, its importance is subject to interpretation. As we can
see, in both models we are able to extract progressively less rules as the
minimal support and minimal con dence that are requested grow. To each solution
is associated a mask, that is, the set of values (k1; l1); (k2; l2); : : : ; (kn; ln) that
correspond to the particular discretization; this mask, in turn, gives rise to the
values that have been used to decide the bin to which each attribute of each
particular instance belongs. As it often happens in rule extraction, interpreting
the results is not immediate due to the number of extracted rules. While a
correct and detailed N O2 contamination model is outside the scope of this paper,
from [
        <xref ref-type="bibr" rid="ref11 ref12">11, 12</xref>
        ] a general principle emerges: to more tra c, and to less wind,
corresponds higher values of N O2 in the atmosphere. Therefore, in searching for
particular cases that may add explanatory value to the general model, we are
interested in rules that defy such a general principle, and may therefore indicate
that other parameters (inside or outside the available data set) play some role.
There are three situations that may be interesting in this sense: higher N O2
with lower tra c; higher N O2 with no tra c (i.e., rules in which the tra c
value has no role); and lower N O2 with high tra c. As it turns out, from the
optimization models (4) and (6), rules that belong to the third group do occur;
examples of these are in Table 4. Observe that, since both optimization models
minimize the number of bins, such discovered rules encompass binary decisions
(i.e., two labels) for all variables which are (arguably) informative for the speci c
domain-application.
      </p>
      <p>Comparison with existing methods. A natural question at this point is
whether we could have obtained similar results with the existing methods. To
answer this question we considered a static discretizer (the class Discretize
in WEKA, which behaves identically to the other available static lters in R
and in Python). As we have discussed in Section 2, a static discretizer
usually o ers equal-width and equal-frequency binning. While for normally
distributed variables (i.e., Gaussian-like) both settings may return meaningful
results, for non-normally distributed ones a further analysis of this aspect is
necessary. Consider the case, for example, of the variable N O2 in our data, which
is strongly right-skewed. In Figure 2 we compare the result obtained by the
three di erent solutions (equal-width, equal-frequency, and our dynamic
discretizer) in the case of two bins; because of the distribution, equal-width
binning in this case returns a bin (N O2 117:64) which is meaningless: as a
matter of fact, all rules that can be extracted with the di erent settings
(support varying from 0.1 to 0.4, con dence varying from 0.7 to 0.85) return rules
with that particular bin as consequent, which is uninformative because it is true
almost in every instance. Therefore, equal-width binning makes little sense in
our data set. Equal-frequency binning returned better results. For an adequate
comparison, for each experimental setup, we have chosen the best mask (e.g.,
[(0:2; 2); (0:4; 2); (1:0; 3); (1:0; 2); (0:7; 5); (0:6; 5); (1:0; 2)]) returned by our
algorithm, and asked the static lter to use that particular choice as number of
bins for each variable (observe that deciding the number of bins is a problem
in static binning - obviously, choosing the best option goes towards the fairest
comparison). The results of such an experiments are shown in Table 5: only a
few rules emerged, and none of them falls in one of the interesting categories that
we have mentioned above. The most frequent result in all experiment shows a
3bins splitting for N O2, and Figure 3 gives us a hint of the problems that emerge
during equal-frequency binning: as one can see, the resulting middle group is too
narrow for a meaningful rule to be extracted.
6</p>
    </sec>
    <sec id="sec-6">
      <title>Conclusions</title>
      <p>In this paper we have considered a data set that represents the hourly
measurement of several air quality parameters on a speci c monitoring station in
the center of Wroclaw (Poland) during the interval of three years. Instead of
searching for a general explanation model for these data, we have focused on
extracting meaningful local rules w.r.t. the pollutant, which may be useful to
model the particular situations that occurred during the measurement period.
We proposed and tested a multivariate, non-deterministic, distribution-based
discretization algorithm coupled with the well-known rule extraction algorithm
APRIORI, and implemented it via the evolutionary algorithm NSGA-II. We
experimentally proved that our solution produces more rules and, in some cases,
more interesting rules w.r.t. the speci c domain-application than those produced
by the discretization algorithms available in some open-source learning libraries.</p>
    </sec>
    <sec id="sec-7">
      <title>Appendix: NP-hardness of Optimal Binning</title>
      <p>
        It is well known that optimal preprocessing is a computationally hard problem,
and commonly accepted that learning algorithms use sub-optimal (deterministic
or heuristic-based) solutions. Yet, precisely pinpointing the formal problem is
mathematically interesting per se. Discretization as a classi cation task has been
studied from the theoretical point of view in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], and shown to be NP-hard; in
this section we prove how discretization for rule extraction can be reduced to it.
      </p>
      <p>Consider a numerical data set A with n features plus one (categorical) class
D (in this context, referred to as decision):</p>
      <p>2 a11 a12 : : : a1n d1 3
A = 664 a:2:1: a:2:2: :: :: :: a: 2: n: :d:s:757</p>
      <p>am1 am2 : : : amn dm</p>
      <p>A pair (Ai; c), where Ai is an attribute and c 2 R is called cut. Any set of
cuts f(Ai; c1); : : : ; (Ai; cl)g implicitly de nes the partition f( 1; c1); [c1; c2); : : : ;
[cl; +1)g (denoted f i1; : : : ; ili g in Section 3). Having a partition for each
attribute in A allows us to discretize the original data set to obtain a categorical
one:</p>
      <p>m1 m2 : : : mn dm
Such a discretization is said to be D-consistent if there are no two instances
with the same categorical values and di erent class; in other words a D-consistent
transformation is the perfect classi cation. If A can be D-consistently discretized
using at most l cuts (in total), we write l ! A. Now, let n = 2 and let D be a
binary class. One can de ne the language:</p>
      <p>
        L = fhA; li j l ! Ag
In [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], it has been shown that deciding L is NP-hard. Adapting this result to
our case is now easy. Indeed, the problem of nding the perfect discretization
for extracting association rules from a numerical data set can be formalized as
follows. Let A be a numerical data set with n attributes, each of which we can
partition in the same way as before. Each discretization implicitly entails the
existence of rules with a certain support and con dence, and, in particular, of
rules whose consequent is any handpicked attribute; let us focus on rules with Am
as consequent. As we know, rules are evaluated by their support and con dence.
Let us denote by l; t !s;c A the fact that A can be discretized in such a way
that no more than l (total) bins are used, of which exactly t are the bins of the
attribute Am, in such a way that for each interval of the attribute Am a group
of rules can be extracted with con dence at least c and such that the sum of all
supports is at least s. Observe that this discretization arguably describes what,
in Section 3, we have called extracting the highest possible number of meaningful
and interpretable rules. The problem of nding the perfect discretization in such
terms can be then described as a decision problem, as follows:
      </p>
      <p>L = fhA; l; t; s; ci j l; t !s;c Ag
Theorem 1. L is N P -hard.</p>
      <p>Proof. The proof is by polynomial reduction, that is, we prove that L p L. To
this end, let A be a numerical data set with n = 2 and a binary decision D. We
produce a numerical data set A0 with n = 3, where A01 = A1, A02 = A2, and
A03 has domain f0; 1g (that is, we copy the entire data set column-by-column,
interpreting the decision as a numerical attribute). Now, we claim that l ! A if
and only if l + 2; 2 !1;1 A0, that is, hA; li 2 L if and only if hA; l + 2; 2; 1; 1i 2 L.
Suppose, rst, that l + 2; 2 !1;1 A0. By de nition, there exists at least one
rule 1 ^ : : : ^ s ! 0 and at least one rule 10 ^ : : : ^ s00 ! 1 that hold in
(the discretized counterpart of) A0 with minimal con dence 1. Because of the
requirement on the minimal total support, every instance is the support of some
rule; because of the requirement on the minimal local con dence, no instance
can be in the support of more than one rule. It is now immediate to interpret
the set of extracted rules as a rule-based classi er with perfect score, that is, to
see that l ! A. Suppose, on the other hand, that l ! A holds. Every instance
can be seen as a rule; all such rules have con dence at least one, because A
is D-consistently discretized, and no instance is left without its corresponding
rule, which means that the total support is 1, that is, that l + 2; 2 !1;1 A0,as we
wanted.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>R.</given-names>
            <surname>Agrawal</surname>
          </string-name>
          and
          <string-name>
            <given-names>R.</given-names>
            <surname>Srikant</surname>
          </string-name>
          .
          <article-title>Fast algorithms for mining association rules in large databases</article-title>
          .
          <source>In Proc. of the 20th International Conference on Very Large Data Bases</source>
          , pages
          <volume>487</volume>
          {
          <fpage>499</fpage>
          ,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>R.</given-names>
            <surname>Agrawal</surname>
          </string-name>
          and
          <string-name>
            <given-names>R.</given-names>
            <surname>Srikant</surname>
          </string-name>
          .
          <article-title>Mining sequential patterns</article-title>
          .
          <source>In Proc. of the 11th International Conference on Data Engineering</source>
          , pages
          <volume>3</volume>
          {
          <fpage>14</fpage>
          ,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>R.</given-names>
            <surname>Agrawal</surname>
          </string-name>
          and
          <string-name>
            <given-names>R.</given-names>
            <surname>Srikant</surname>
          </string-name>
          .
          <article-title>Mining quantitative association rules in large relational tables</article-title>
          .
          <source>SIGMOD Rec</source>
          .,
          <volume>25</volume>
          (
          <issue>2</issue>
          ):1{
          <fpage>12</fpage>
          ,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4. V.
          <article-title>Bart k and J</article-title>
          .
          <source>Zendulka. Distance-Based Methods for Association Rules Mining</source>
          , pages
          <volume>689</volume>
          {
          <fpage>694</fpage>
          .
          <source>IGI Global, 2nd edition</source>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>B.</given-names>
            <surname>Chlebus</surname>
          </string-name>
          and
          <string-name>
            <given-names>S.</given-names>
            <surname>Nguyen</surname>
          </string-name>
          .
          <article-title>On nding optimal discretizations for two attributes</article-title>
          .
          <source>In Proc. of the 1st International Conference on Rough Sets and Current Trends in Computing</source>
          , pages
          <volume>537</volume>
          {
          <fpage>544</fpage>
          ,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Y.</given-names>
            <surname>Collette</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.</given-names>
            <surname>Siarry</surname>
          </string-name>
          .
          <source>Multiobjective Optimization: Principles and Case Studies</source>
          . Springer Berlin Heidelberg,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>K.</given-names>
            <surname>Deb</surname>
          </string-name>
          <article-title>. Multi-objective optimization using evolutionary algorithms</article-title>
          . Wiley, London, UK,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>J.</given-names>
            <surname>Durillo</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Nebro</surname>
          </string-name>
          .
          <article-title>jMetal: a java framework for multi-objective optimization</article-title>
          .
          <source>Avances in Engineering Software</source>
          ,
          <volume>42</volume>
          :
          <fpage>760</fpage>
          {
          <fpage>771</fpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>C.</given-names>
            <surname>Emmanouilidis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Hunter</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Macintyre</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C.</given-names>
            <surname>Cox</surname>
          </string-name>
          .
          <article-title>A multi-objective genetic algorithm approach to feature selection in neural and fuzzy modeling</article-title>
          .
          <source>Evolutionary Optimization</source>
          ,
          <volume>3</volume>
          (
          <issue>1</issue>
          ):1{
          <fpage>26</fpage>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>F.</given-names>
            <surname>Jimenez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Sanchez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Garc</surname>
          </string-name>
          <string-name>
            <surname>a</surname>
          </string-name>
          , G. Sciavicco, and
          <string-name>
            <given-names>L.</given-names>
            <surname>Miralles</surname>
          </string-name>
          <article-title>. Multi-objective evolutionary feature selection for online sales forecasting</article-title>
          .
          <source>Neurocomputing</source>
          ,
          <volume>234</volume>
          :
          <fpage>75</fpage>
          {
          <fpage>92</fpage>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <given-names>J. A.</given-names>
            <surname>Kaminska</surname>
          </string-name>
          .
          <article-title>Probabilistic forecasting of nitrogen dioxide concentrations at an urban road intersection</article-title>
          .
          <source>Sustainability</source>
          ,
          <volume>10</volume>
          (
          <issue>11</issue>
          ),
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <given-names>J. A.</given-names>
            <surname>Kaminska</surname>
          </string-name>
          .
          <article-title>A random forest partition model for predicting N O2 concentrations from tra c ow and meteorological conditions</article-title>
          .
          <source>Science of the Total Environment</source>
          ,
          <volume>651</volume>
          :
          <fpage>475</fpage>
          {
          <fpage>483</fpage>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <given-names>B.</given-names>
            <surname>Lent</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Swami</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Widom</surname>
          </string-name>
          .
          <article-title>Clustering association rules</article-title>
          .
          <source>In Proc. of the 13th International Conference on Data Engineering</source>
          , pages
          <volume>220</volume>
          {
          <fpage>213</fpage>
          . IEEE,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14. B.
          <string-name>
            <surname>Minaei-Bidgoli</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Barmaki</surname>
            , and
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Nasiri</surname>
          </string-name>
          .
          <article-title>Mining numerical association rules via multi-objective genetic algorithms</article-title>
          .
          <source>Information Sciences</source>
          ,
          <volume>233</volume>
          :
          <fpage>15</fpage>
          {
          <fpage>24</fpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>M. N. Moreno</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Segrera</surname>
            ,
            <given-names>V. F.</given-names>
          </string-name>
          <string-name>
            <surname>Lopez</surname>
            , and
            <given-names>M. J.</given-names>
          </string-name>
          <string-name>
            <surname>Polo</surname>
          </string-name>
          .
          <article-title>A method for mining quantitative association rules</article-title>
          .
          <source>In Proc. of the 6th WSEAS International Conference on Simulation, Modelling and Optimization</source>
          , pages
          <volume>173</volume>
          {
          <fpage>178</fpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <given-names>A.</given-names>
            <surname>Mukhopadhyay</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            <surname>Maulik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Bandyopadhyay</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C. C.</given-names>
            <surname>Coello</surname>
          </string-name>
          .
          <article-title>A survey of multiobjective evolutionary algorithms for data mining: Part I</article-title>
          .
          <source>IEEE Transactions on Evolutionary Computation</source>
          ,
          <volume>18</volume>
          (
          <issue>1</issue>
          ):4{
          <fpage>19</fpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17. B.
          <article-title>Ozden, S. Ramaswamy, and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Silberschatz</surname>
          </string-name>
          .
          <article-title>Cyclic association rules</article-title>
          .
          <source>In Proc. of the 14th International Conference on Data Engineering</source>
          , pages
          <volume>412</volume>
          {
          <fpage>421</fpage>
          ,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <given-names>F.</given-names>
            <surname>Pedregosa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Varoquaux</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Gramfort</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Michel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Thirion</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Grisel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Blondel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Prettenhofer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Weiss</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Dubourg</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Vanderplas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Passos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Cournapeau</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Brucher</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Perrot</surname>
          </string-name>
          , and
          <string-name>
            <given-names>E.</given-names>
            <surname>Duchesnay</surname>
          </string-name>
          .
          <article-title>Scikit-learn: Machine learning in Python</article-title>
          .
          <source>Journal of Machine Learning Research</source>
          ,
          <volume>12</volume>
          :
          <fpage>2825</fpage>
          {
          <fpage>2830</fpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <given-names>R Core</given-names>
            <surname>Team. R:</surname>
          </string-name>
          <article-title>A Language and Environment for Statistical Computing</article-title>
          . R Foundation for Statistical Computing, Vienna, Austria,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20. A.
          <string-name>
            <surname>Salleb-Aouissi</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Vrain</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Nortet</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          <string-name>
            <surname>Kong</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          <string-name>
            <surname>Rathod</surname>
            , and
            <given-names>D.</given-names>
          </string-name>
          <string-name>
            <surname>Cassard</surname>
          </string-name>
          .
          <article-title>Quantminer for mining quantitative association rules</article-title>
          .
          <source>Journal of Machine Learning Research</source>
          ,
          <volume>14</volume>
          (
          <issue>1</issue>
          ):
          <volume>3153</volume>
          {
          <fpage>3157</fpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <given-names>Q.</given-names>
            <surname>Tong</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Yan</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Y.</given-names>
            <surname>Zhou</surname>
          </string-name>
          .
          <article-title>Mining quantitative association rules on overlapped intervals</article-title>
          .
          <source>In Proc. of the 1st International Conference on Advanced Data Mining and Applications</source>
          , pages
          <volume>43</volume>
          {
          <fpage>50</fpage>
          . Springer-Verlag,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22. I.
          <string-name>
            <surname>Witten</surname>
            , E. Frank, and
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Hall</surname>
          </string-name>
          .
          <article-title>Data mining: practical machine learning tools and techniques, 3rd Edition</article-title>
          . Morgan Kaufmann, Elsevier,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>