<!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>Incremental Construction of Complex Aggregates: Counting over a Secondary Table</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Clement Charnay</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Nicolas Lachiche</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Agnes Braud</string-name>
          <email>agnes.braudg@unistra.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>ICube, Universite de Strasbourg, CNRS 300 Bd Sebastien Brant - CS 10413</institution>
          ,
          <addr-line>F-67412 Illkirch Cedex</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this paper, we discuss the integration of complex aggregates in the construction of logical decision trees. We review the use of complex aggregates in TILDE, which is based on an exhaustive search in the complex aggregate space. As opposed to such a combinatorial search, we introduce a hill-climbing approach to build complex aggregates incrementally.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Relational data mining deals with data represented by several tables. We focus
on the typical setting where one table, the primary table, contains the target
column, i.e. the attribute whose value is to be predicted, and has a one-to-many
relationship with a secondary table. A possible way of handling such relationships
is to use complex aggregates, i.e. to aggregate the objects of the secondary
table which meet a given condition, using an aggregate function on the objects
themselves (count function) or on a numerical attribute of the objects (e.g. max,
average functions). For instance, we may want to classify molecules. Molecules
have atoms. They can be represented as a table of molecules and a table of atoms,
with a foreign key in the table of atoms indicating the molecule it belongs to.
Then, the class of a molecule may depend on the comparison between the average
of the charge of the carbon atoms of the molecule and some threshold value. This
example also shows what a complex aggregate relies on: an aggregate function
(here the average), a condition to select the objects to aggregate (here we select
only the carbon atoms), the attribute to aggregate on (here the charge of the
atoms), an operator and a threshold to make a comparison with the result of
the aggregation.</p>
      <p>
        Previous work showed that the expressivity of complex aggregates can be
useful to solve problems such as urban blocks classi cation. [
        <xref ref-type="bibr" rid="ref1 ref2">1,2</xref>
        ] introduced
complex aggregates in propositionalisation. But their use increases the size of
the feature space too much, and they cannot be fully handled. This is the reason
why we focus on introducing them in the learning step. To our knowledge, only
one relational learner, TILDE [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], has implemented complex aggregates, but its
exhaustive approach is not adapted to too complex problems. The main
motivation for our work is to elaborate new heuristics to handle complex aggregates in
relational models. This article presents a logical decision tree learner which uses
complex aggregates to deal with secondary tables, using a hill-climbing heuristic
to build them incrementally. We introduce this heuristic in the context of logical
decision trees, but it could be applied to other approaches. In this article, we
focus on counting over a secondary table, i.e. the aggregate function considered
will be the count function.
      </p>
      <p>The rest of this paper is organized as follows. In Sect. 2, we review the use
of complex aggregates in TILDE. In Sect. 3, we describe our heuristic to explore
the complex aggregate space. Finally, in Sect. 4, we detail future work.
2</p>
    </sec>
    <sec id="sec-2">
      <title>TILDE and Complex Aggregates</title>
      <p>
        TILDE [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] is a rst-order decision tree learner. It uses a top-down approach
to choose, node by node, from root to leaves, the best re nement to split the
training examples according to their class values, using gain ratio as a metric to
guide the search. TILDE relies on a language bias: the user speci es the literals
which can be added in the conjunction at a node. In this relational context, to
deal with secondary tables, the initial version of TILDE introduces new variables
from these secondary tables using an existential quanti er.
      </p>
      <p>
        Then, TILDE has been extended [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] to allow the use of complex aggregates,
and a heuristic has been developed to explore the search space [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. This heuristic
is based on the idea of a re nement cube, where re nement space for the
aggregate condition, aggregate function and threshold are the dimensions of the cube.
This cube is explored in a general-to-speci c way, using monotone paths along
the di erent dimensions: when a complex aggregate (a point in the re nement
cube) is too speci c (i.e. it fails for every training example), the search does not
restart from this point.
      </p>
      <p>However, the implementation does not allow more than two conjuncts in the
aggregate query "due to memory problems" [6, p. 32], which limits the search
space. Numerical attributes are handled by a comparison to a threshold in
problems such as geographical ones. It is possible to discretize numerical attributes
beforehand and to de ne predicates to make those comparisons between the
values of the attributes and the thresholds given by the discretization. Nevertheless,
enumerating all the combinations of thresholds over all the numerical attributes
takes space in memory, and hence the approach is not tractable. To summarize,
this combinatorial approach which handles complex aggregates in TILDE has
limitations. We intend to overcome these limitations by not trying to explore
the search space exhaustively, but by nding a heuristic to explore the search
space and to build complex aggregates incrementally.
3</p>
      <p>Incremental Construction of Complex Aggregates with
Hill-Climbing
Our goal is to build a logical decision tree, like TILDE, which uses complex
aggregates to deal with secondary tables. To explore the re nement cube of
complex aggregates, we choose to use a hill-climbing method. This section details the
method. We use the general notation "f unction(condition)foperatorgthreshold"
to refer to a complex aggregate.
3.1</p>
      <sec id="sec-2-1">
        <title>Re nement of Complex Aggregates</title>
        <p>When testing an aggregate, we make a re nement to nd the best aggregate,
and a hill-climbing is performed from a starting aggregate. In this paper, we
limit ourselves to the count function to aggregate secondary tables. The starting
conditions are detailed below. We then try to re ne it with hill-climbing,
allowing a non-strict climbing: if there is no strictly improving re nement, we allow
picking a re nement with the same score as in the previous step, if it has not
been visited before. To achieve that, we store all previous re nements chosen
in the hill-climbing path. From the current aggregate, there are several ways to
modify it:
{ Firstly, given the examples, we compute the possible results of the aggregate
function, which will serve as possible thresholds. To these values, we add one
threshold depending on the operator: strictly lower than the other values
if the operator is (so that the complex aggregate is true for none of the
examples) and strictly higher if the operator is . Such thresholds are chosen
to be respectively MAX DOUBLE and its opposite. The current threshold
is then set to the closest possible threshold if it is lower than the minimum
or higher than the maximum of the possible thresholds. For instance, if the
current re nement to try is "the count of atoms in the molecule is less than
or equal to M AX DOU BLE" and, in the training set, there are between
13 and 42 atoms in a molecule, the threshold will be immediately set to 42.
{ Then, we can re ne the aggregate by increasing or decreasing the threshold
(among the possible thresholds).
{ Other possibilities are to remove a literal from the aggregate condition, or
to add one.</p>
        <p>The Starting Conditions Given this, if we refer to the maximum threshold
as max, 2 starting conditions will be count(true) max and count(true)
M AX DOU BLE. From the point of view of the examples considered, they are
opposite: if one succeeds for an example, the other will fail. The former is the
most general (i.e. it succeds for every example), the latter the most speci c. We
then observe that re nements for one will have the same e ect on information
gain for the other (the nal branch of the examples will be inverted between
both), so on the training set, they are equivalent, and will be re ned
equivalently. In the end, we get two conditions count(condition) someT hreshold
and count(condition) nextT hreshold which are opposite. To conclude on this
point, considering both starting conditions is not necessary, since they will be
re ned following similar paths and will yield the same information gain after
the hill-climbing process. Of course, the same reasoning applies for starting
conditions count(true) M AX DOU BLE and count(true) min, this is the
reason why we consider only two starting conditions, arbitrarily with the
operator .</p>
        <p>Moving in the Complex Aggregate Space We now discuss our method for
re nement of the aggregate. If we add a literal to the aggregate condition, it
will yield a specialization and less objects will be selected. The threshold range
discussed above will not be the same, and the current threshold, associated to the
previous, more general condition, will not be relevant since it may be too high.
Hence, the re nement will yield a poor gain ratio and will not be chosen. For
instance, in the training set, there are between 13 and 42 atoms in a molecule,
but only between 5 and 20 carbon atoms. If the current aggregate states that
"the count of atoms is less than or equal to 30", and we try to re ne it to "the
count of carbon atoms is less than or equal to 30", this last aggregate will be true
for every example, yielding zero gain, and hence will not be chosen. Of course,
the problem will be similar if we consider the other way, i.e. if we drop a literal
from the aggregate condition, yielding a generalization.</p>
        <p>To avoid modifying the aggregate condition without modifying the threshold,
we do as follows. When modifying the aggregate condition, we consider the
number of possible thresholds n1 given by the current aggregate condition, and
the number of thresholds n2 given by the next (after modi cation) aggregate
condition. We sort those two sets those thresholds in increasing order, such that
the current threshold is in position c1 with indices going from 0 to n1 1, the
next threshold chosen, in position c2 between 0 and n2 1 will be picked such
that n2c2 1 is closest to n1c1 1 . Mathematically: c2 = round( c1 n(n12 1 1) ). Since we
add a threshold to a list which already contains at least one element, there are
always at least two possible thresholds and hence the case n1 = 1 is not an issue.
3.2</p>
      </sec>
      <sec id="sec-2-2">
        <title>Dealing with Empty Sets</title>
        <p>
          We nally discuss a problem that will occur with aggregate functions other than
count : the computation of a value for empty sets. Indeed, an aggregate condition
might select no object, and aggregation over a numerical attribute is not possible
in this case. For instance, how can the mean of the charge of the oxygen atoms
in a molecule be computed when the molecule does not have any oxygen atom?
Only the count function can deal in a natural way with empty sets, while another
solution has to be chosen for numerical aggregate functions. Some possibilities
to deal with this issue have been discussed in [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]:
{ Fixing an arbitrary value as the result.
{ Using a value depending on the aggregate condition, as close as possible to
the values for examples for which the aggregate condition does not result in
an empty set, or as far as possible.
{ Failing the aggregate when the aggregate function cannot be applied.
{ Discarding the aggregate from being chosen as a re nement if the aggregate
function cannot be applied for at least one example.
        </p>
        <p>In our opinion, the two rst options are not easy to apply for every function.
Indeed, for functions min or max, one can choose values as low or as high as
possible so that the aggregate always succeeds or fails if the function cannot
be applied directly. But for the average function, using a xed value such as
0 is not relevant if the attribute can take both positive and negative values,
neither is choosing positive or negative in nity. Moreover, the fact that the set to
aggregate is empty can be meaningful, and by assigning a result to the aggregate
function we lose this signi cance. The third option also gives to the empty set a
meaning we do not necessarily want it to have: the failure of the aggregate should
mean the inequality between the result of the aggregation and the threshold
is wrong. However, this is not the meaning of the empty set. Actually, it is
implied by the failure of the existential quanti er for the aggregate condition,
i.e. count(condition) 1 fails.</p>
        <p>Then we see two ways to address the issue of empty sets: rstly to consider
them as a third branch in our decision trees, since they do not correspond to a
success or a failure of the inequality, they are a third possibility. However, this
option breaks the binary structure of the tree, which is not necessarily a problem.
Nevertheless, we present another option to preserve the binary tree structure:
the principle is to create a node with the count(condition) 1 aggregate before
adding a node with an aggregate with a function which may not be applicable. In
the left branch, we can then add the aggregate f unction(condition) threshold
without the empty set problem, since we know from the parent node that
condition will select at least one object. This adapts the three-branch idea to
preserve the binary tree structure, using two nodes instead of one. An example is
shown in Fig. 1, where the aggregate "the average charge of the carbon atoms in
the molecule is greater than or equal to 0.542" is "protected" by the existential
quanti er which tests the presence of at least one carbon atom in the molecule,
i.e. the aggregate "the count of carbon atoms in the molecule is greater than or
equal to 1". If the latter succeeds, then the former can be evaluated because
it is meaningful to compute the average value of a non-empty set. If the
existential quanti er fails, then the average is not computed because it would be
meaningless.
4</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Conclusion and Future Work</title>
      <p>
        The method described in Sect. 3 is implemented and will be evaluated. The next
step in this work is to consider other aggregate functions, on numerical attributes
of the secondary objects, and to allow the change of the aggregate function in
the re ning process of the aggregates, by taking advantage of their ordering as
in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Then, another step will be to allow recursivity in the aggregates, i.e.
create complex aggregates which have complex aggregates in their aggregate
condition, to use the whole database. However, this will inevitably raise new
issues, since this will add other levels of re nements. A more complex problem
will be to handle many-to-many relationships, since the complex aggregates can
avg(C, (atom(A,B), atom type(B,carbon),
atom charge(A,C)), Res2), Res2 0.542
.
.
.
      </p>
      <p>true
count(B, (atom(A,B),
atom type(B,carbon)), Res1), Res1
1
true
false
.
.
.
.
.
.</p>
      <p>false
.
.
.
be formed both ways with such relationships, which can possibly lead to loops
in the recursivity discussed above.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>El</given-names>
            <surname>Jelali</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Braud</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Lachiche</surname>
          </string-name>
          , N.:
          <article-title>Propositionalisation of continuous attributes beyond simple aggregation</article-title>
          . In Riguzzi, F.,
          <string-name>
            <surname>Zelezny</surname>
          </string-name>
          , F., eds.
          <source>: ILP</source>
          . Volume
          <volume>7842</volume>
          of Lecture Notes in Computer Science., Springer (
          <year>2012</year>
          )
          <volume>32</volume>
          {
          <fpage>44</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Puissant</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lachiche</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Skupinski</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Braud</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Perret</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mas</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Classi cation et evolution des tissus urbains a partir de donnees vectorielles</article-title>
          .
          <source>Revue Internationale de Geomatique</source>
          <volume>21</volume>
          (
          <issue>4</issue>
          ) (
          <year>2011</year>
          )
          <volume>513</volume>
          {
          <fpage>532</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Blockeel</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Raedt</surname>
          </string-name>
          , L.D.:
          <article-title>Top-down induction of rst-order logical decision trees</article-title>
          .
          <source>Artif. Intell</source>
          .
          <volume>101</volume>
          (
          <issue>1-2</issue>
          ) (
          <year>1998</year>
          )
          <volume>285</volume>
          {
          <fpage>297</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Assche</surname>
            ,
            <given-names>A.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vens</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Blockeel</surname>
          </string-name>
          , H., Dzeroski, S.:
          <article-title>First order random forests: Learning relational classi ers with complex aggregates</article-title>
          .
          <source>Machine Learning</source>
          <volume>64</volume>
          (
          <issue>1-3</issue>
          ) (
          <year>2006</year>
          )
          <volume>149</volume>
          {
          <fpage>182</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Vens</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ramon</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Blockeel</surname>
          </string-name>
          , H.:
          <article-title>Re ning aggregate conditions in relational learning</article-title>
          . In Furnkranz, J., Sche er, T.,
          <string-name>
            <surname>Spiliopoulou</surname>
          </string-name>
          , M., eds.
          <source>: PKDD</source>
          . Volume
          <volume>4213</volume>
          of Lecture Notes in Computer Science., Springer (
          <year>2006</year>
          )
          <volume>383</volume>
          {
          <fpage>394</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Blockeel</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dehaspe</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ramon</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Struyf</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Assche</surname>
            ,
            <given-names>A.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vens</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fierens</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>The ACE Data Mining System</article-title>
          .
          <source>(March</source>
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Vens</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Complex aggregates in relational learning</article-title>
          .
          <source>PhD thesis</source>
          , Informatics Section, Department of Computer Science, Faculty of Engineering Science (March
          <year>2007</year>
          )
          <article-title>Blockeel, Hendrik (supervisor).</article-title>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>