<!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>Business Rule Learning with Interactive Selection of Association Rules</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Stanislav Voj r</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Premysl Vaclav Duben</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Tomas Kliegr</string-name>
          <email>tomas.kliegrg@vse.cz</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Information and Knowledge Engineering Faculty of Informatics and Statistics University of Economics</institution>
          ,
          <addr-line>Prague</addr-line>
          ,
          <country country="CZ">Czech Republic</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper presents the implementation of a classi cation system based on learning of association rules in conjunction with Drools rule engine. The rules are interactively discovered with a web-based data mining system EasyMiner.eu. The rules are approved and edited by the domain expert before they are deployed for classi cation.</p>
      </abstract>
      <kwd-group>
        <kwd>association rules</kwd>
        <kwd>business rules</kwd>
        <kwd>drools</kwd>
        <kwd>classi cation</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Today, there is an increasing demand for decision support systems (DSS). The
penetration of DSS solutions to many domains is sti ed by the fact that building
a DSS requires a signi cant amount of time from users, who need to be not only
domain experts, but also skilled knowledge engineers. While algorithmic support
for decision making support is a complex endeavour, many problems can be
cast as a classi cation task for which a model can be induced automatically
from data. Example of such tasks include answering questions such as: "Is this
product appropriate for this customer?", or "Is the user interested in this media
content?"</p>
      <p>While a plethora of machine learning algorithms exist, most of them produce
\black box" models which are di cult to comprehend and manipulate. Decision
tree induction and rule induction su er from this problem, perhaps, the least.
The advantage of these models that the they consists of individual units of
knowledge (rules),1 which can be separately viewed, evaluated and manipulated
{ deleted or even edited.</p>
      <p>This paper presents a complete implementation of a prototype decision
support system, which:
{ automatically learns decision rules from data,
{ allows the domain expert to edit the resulting rule base,
{ deploys the rules to a Business Rule Management System (BRMS), which
can apply the rules to score incoming objects.
1 Decision trees can be converted to rules.</p>
      <p>The system is built on top of the data mining system EasyMiner and a BRMS
system Drools Expert.</p>
      <p>This paper is organized as follows: Section 2 presents the motivation and
related work. Section 3 describes individual steps of the preparation process of
a classi cation rule set. Section 4 covers the implementation. The conclusion
presents the technical details of the demo and with an outlook for further work.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Motivation and Related work</title>
      <p>We motivate our technological solution with the following use case.</p>
      <p>Use case example. Alice works as a business analyst for a small community
bank. She is assigned a task to prepare a credit scoring application. She has
at her disposal a dataset describing loans awarded and the rating of the
loan after a one year period. Applying a rule learning algorithm yields a
classi cation model consisting of 100 rules.</p>
      <p>Looking at the rules, Alice is not absolutely satis ed. She deletes some of the
rules, which seem to be artifacts of the data, and introduces new rules that
represent well-known relations between client demographics and rating that
were omitted by the learning algorithm. After verifying that the accuracy of
the edited rule set increased on a holdout dataset, she deploys the model.</p>
      <p>If Alice would have to rely on commodity rule learning systems, she would
have to probably export the rule learning results into the PMML format2, edit
the resulting XML, and import the result to a scoring engine. The system
presented in this paper allows to accomplish the task through a chain of web-based
graphical tools, which are built on top of industry standard BRMS software and
open formats.</p>
      <p>
        Research of "business rules" generation from data mining results is a current,
yet not very exposed, research topic. To the best of our knowledge, the only
publicly available software solution to business rule learning is Rule learner [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
Rule learner is a part of OpenRules Decision Management System 3, which uses
Weka system4 to perform rule learning. The learned rules are presented in the
form of decision tables in Microsoft Excel worksheets.
      </p>
      <p>
        However, there are several experimental systems developed in the machine
learning community with related functionality. MIME Framework [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] is a desktop
application built also on top of Weka, which provides interactive rule mining and
ltering of discovered rules.
      </p>
      <p>
        The EasyMiner system [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], used in our solution, combines user-de ned
constraints on the search space with interactive mining. The interactive nature of
MIME and EasyMiner systems can help to address the excessive number of
2 http://www.dmg.org/pmml-v4-0-1.html
3 http://www.openrules.com
4 http://www.cs.waikato.ac.nz/ml/weka/
rules that are typically on the output of rule learning. Additionally, in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] we
have shown that the CBA database pruning algorithm can reduce the number of
rules output by EasyMiner signi cantly, without adversely impacting the quality
of the classi er.
      </p>
      <p>BigML5 is perhaps the most well-known representative of web-based tools.
BigML uses decision tree induction, but allows to export the resulting tree also
into a rule set.</p>
      <p>Here we present EasyMiner-BR, as an extension of the EasyMiner system.
Compared to other software packages described above, EasyMiner-BR covers the
entire work ow in a single environment. Within one web application, the user
can launch multiple rule learning tasks, export selected rules to the knowledge
base (business rule base), edit the saved rules and apply the rules on test data.</p>
      <p>
        The brCBA rule learning algorithm used in EasyMiner-BR for building
classi ers from association rules is evaluated and described in detail in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. This
paper presents the implemented software solution in a demo form. The
contribution, with respect to the published results [
        <xref ref-type="bibr" rid="ref7 ref8">7,8</xref>
        ], is in the integration of the
EasyMiner system with the brCBA algorithm, and with the editor of classi
cation "business" rules.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Rule base preparation work ow</title>
      <p>The process of preparing a rule base in EasyMiner-BR can be divided into
several consecutive steps which are presented on Figure 1: 1) data preparation, 2)
association rule learning, 3) rule selection, 4) classi cation model testing, 5) rule
set editing and 6) deployment of rules to BRMS. These steps, which can be
performed with a standard web browser, are described in the following.
3.1</p>
      <sec id="sec-3-1">
        <title>Data preparation</title>
        <p>The user starts with a dataset for training of the classi cation model. Typically,
the dataset is divided into a training and a testing part. Currently, the system
does not support an automatic split of the input table into a testing and training
subset, the user needs to perform this task with other tools.</p>
        <p>The dataset for model training (association rule learning) can be stored in
a CSV le or in a MySQL database. The user inputs connection information
or uploads a CSV le. While uploading, the user is able to select le encoding,
separators etc.</p>
        <p>
          For association rule learning, it is usually necessary to discretize numerical
columns. The system supports several types of preprocessing. For numerical
columns, the user can de ne preprocessing using intervals. For nominal as well
as numerical columns, the user can merge values by enumeration, creating bins
of values. More details can be found in [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ].
        </p>
        <sec id="sec-3-1-1">
          <title>5 http://bigml.com</title>
          <p>Fig. 1. Rule base preparation for the classi cation task
3.2</p>
        </sec>
      </sec>
      <sec id="sec-3-2">
        <title>Association rule learning</title>
        <p>
          As a rule learning algorithm, the current version uses the GUHA procedure
ASSOC implemented in LISp-Miner system [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ].
        </p>
        <p>To start association rule learning in EasyMiner6, the user is required to
input a rule pattern de nition. The user selects attributes from attributes palette
and places them into a rule pattern pane, which de nes the pattern that the
discovered rules must match. By default, the attributes are connected with a
conjunction, but the system supports also disjunction and negation connectives.</p>
        <p>For each attribute in the rule pattern it is also possible to de ne the set
of its values considered during mining. Supported options are xed value (the
user selects one value or value group de ned in the preprocessing phase), simple
wildcard (the system tries all possible values) and dynamic binning wildcard (the
system creates new bins by merging those created during preprocessing). 7</p>
        <p>Additionally, the user needs to select at least one interest measure. The
system supports the standard con dence, support, in addition to several other
measures.
3.3</p>
      </sec>
      <sec id="sec-3-3">
        <title>Rule selection</title>
        <p>After association rule learning has been executed, the user is presented with a
list of rules that have been discovered in the data. From this list, the user can
select association rules and save them into the Rule clipboard. The user can then
change the parameters of the rule learning task, typically by making a change
in the rule pattern, and re-execute the learning. In this way, the rule clipboard
accumulates rules discovered during multiple data mining tasks. The rules are
saved grouped by data mining tasks.</p>
        <p>For classi cation, it is vital that the rules that enter the clipboard are chosen
so as to maximize accuracy on the data. To support the user in creating the
best mix of rules, the system o ers a "Check model" link, which displays the
accuracy of the rule set.</p>
        <p>The accuracy is computed either on the training dataset or on a separate test
dataset (uploaded as a CSV le) depending on the user's choice. Upon clicking on
the check model link, the system exports the rules saved in the Rule Clipboard
to the Model Tester component. Model Tester converts the rules into business
rules form (speci cally DRL) and uses the Drools Expert 8 inference engine to
perform the classi cation.</p>
        <p>In case of a rule con ict, which occurs if one object is matched by multiple
rules, the con ict resolution strategy is as follows: matching rules are sorted
according to their con dence, support and antecedent length (in this order).
Out of the matching rules, only the highest ranked one is used for classi cation.</p>
        <sec id="sec-3-3-1">
          <title>6 http://easyminer.eu</title>
          <p>
            7 Dynamic binning is called "coe cient" setup in the LISp-Miner system, and is
described in greater detail e.g. in [
            <xref ref-type="bibr" rid="ref6">6</xref>
            ].
8 http://drools.jboss.org
          </p>
          <p>
            The conversion to the DRL format is described in detail in [
            <xref ref-type="bibr" rid="ref7">7</xref>
            ]. The details
on the use of Drools for classi cation can be found in [
            <xref ref-type="bibr" rid="ref3">3</xref>
            ].
          </p>
          <p>The result from the Model Tester is presented to the user in a graphical
form (Figure 2). The user can see the counts of rows classi ed as true positive
and false positive, as well as accuracy and accuracy (excl. unmatched) . The
di erence between the latter two statistics is that accuracy (excl. unmatched)
does not consider objects that were not matched by any rule as misclassi ed,
while accuracy does. To aid the user in optimizing the rule base, the system
shows also detailed results for each rule from the Rule Clipboard.
3.4</p>
        </sec>
      </sec>
      <sec id="sec-3-4">
        <title>Rule Editor</title>
        <p>For classi cation model building, it is suitable to combine results (association
rules) selected from more than one data mining task. The user can export rules
from the Rule Clipboard into the "business rules" base. For practical purposes,
the rules are internally saved in an XML format. The system allows to convert
the rules into the Drools DRL format.</p>
        <p>The user can display the rules saved in the "business rules" knowledge base
and edit them using a web interface. We developed a simple rule editor, which
presents the rules in a user-friendly, SBVR-like,9 textual form (see Listing 1.1).
9 Semantics of Business Vocabulary and Rules - http://www.omg.org/spec/SBVR/</p>
        <p>Listing 1.1. Format of rules supported in BR Editor
When age i s i n [ 4 6 ; 5 0 . 5 ) then r a t i n g i s C .</p>
        <p>When age i s g r e a t e r than o r e q u a l s 46</p>
        <p>and i s l o w e r than 5 0 . 5 then r a t i n g i s C .</p>
        <p>The rule editor (Fig. 3) allows the user to edit the rules exported from the
rule clipboard, delete them, or add new rules.</p>
        <p>
          Finally, the business rules base can be used for classi cation. The classi
cation engine, available as a REST service, is based on Drools.
EasyMiner (easyminer.eu) is a web-based data mining system [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. The web
interface supports de nition of preprocessing, rule pattern de nition, results
selection etc. The system is written in PHP, user interface is based on HTML5
and the MooTools JavaScript library.
        </p>
        <p>
          LISp-Miner (lispminer.vse.cz) is used for rule learning. It is a Windows
desktop application written in C++. The EasyMiner LMConnect module,
implemented in C#, exposes LISp-Miner via REST web services. The communication
is performed in an extension of PMML [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ].
        </p>
        <p>
          Model tester is written in Java EE. The system uses Drools Expert classes
and the functionality is accessible through REST web services in XML or JSON.
The system creates a brCBA classi er [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] from rules discovered by LISp-Miner.
        </p>
        <p>Business rules editor is implemented as a JavaScript application, which
uses jQuery JavaScript library and HTML5, with PHP backend.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Demo, further work</title>
      <p>The demo of EasyMiner-BR, including screencasts, is accessible at http://
easyminer.eu/. We are currently nishing the two-way integration of Business
rules editor with EasyMiner system. The goal of this integration is to present the
user-de ned rules along the mined rules in Rule clipboard, which would allow a
more informed selection of rules to the clipboard.</p>
      <p>
        In the future work, we would like to explore the possibility of using the
business rule knowledge base already in the process of data mining of association
rules, e.g. as investigated at [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Another focus is the extension of the system
that would allow to mix rules mined from multiple datasets in one knowledge
base. Finally, we consider supporting alternative rule learning backends.
      </p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgment</title>
      <p>This work is supported by the University of Economics in Prague by grants no.
IGA 20/2013 and institutional support (IP 400040).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Bart</given-names>
            <surname>Goethals</surname>
          </string-name>
          , Sandy Moens, and
          <string-name>
            <given-names>Jilles</given-names>
            <surname>Vreeken</surname>
          </string-name>
          .
          <article-title>MIME: A framework for interactive visual pattern mining</article-title>
          .
          <source>In Proceedings of the 17th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD '11</source>
          , pages
          <fpage>757</fpage>
          {
          <fpage>760</fpage>
          , New York, NY, USA,
          <year>2011</year>
          . ACM.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Tomas</given-names>
            <surname>Kliegr</surname>
          </string-name>
          , Andrej Hazucha, and
          <string-name>
            <given-names>Tomas</given-names>
            <surname>Marek</surname>
          </string-name>
          .
          <article-title>Instant feedback on discovered association rules with PMML-based query-by-example</article-title>
          .
          <source>In Sebastian Rudolph and Claudio Gutierrez</source>
          , editors,
          <source>Web Reasoning and Rule Systems</source>
          , volume
          <volume>6902</volume>
          of Lecture Notes in Computer Science, pages
          <volume>257</volume>
          {
          <fpage>262</fpage>
          . Springer Berlin Heidelberg,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Tomas</given-names>
            <surname>Kliegr</surname>
          </string-name>
          , Jaroslav Kuchar, Davide Sottara, and Stanislav Voj r.
          <article-title>Learning business rules with association rule classi ers</article-title>
          .
          <source>In RuleML14 { The 8th International Web Rule Symposium</source>
          . Springer,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Tomas</given-names>
            <surname>Kliegr</surname>
          </string-name>
          and
          <string-name>
            <given-names>Jan</given-names>
            <surname>Rauch</surname>
          </string-name>
          .
          <article-title>An XML format for association rule models based on GUHA method</article-title>
          .
          <source>In RuleML-2010, 4th International Web Rule Symposium</source>
          , Berlin, Heidelberg,
          <year>2010</year>
          . Springer-Verlag.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. OpenRules, Inc. Rule learner. http://www.openrules.com/rulelearner.htm. Accessed:
          <fpage>2014</fpage>
          -04-15.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Jan</given-names>
            <surname>Rauch</surname>
          </string-name>
          and
          <string-name>
            <given-names>Milan</given-names>
            <surname>Simunek</surname>
          </string-name>
          .
          <article-title>An alternative approach to mining association rules</article-title>
          .
          <source>In Foundations of Data Mining and Knowledge Discovery</source>
          , pages
          <volume>211</volume>
          {
          <fpage>231</fpage>
          . Springer,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7. Stanislav Voj r, Tomas Kliegr, Andrej Hazucha, Radek Skrabal, and
          <string-name>
            <given-names>Milan</given-names>
            <surname>Simunek</surname>
          </string-name>
          .
          <article-title>Transforming association rules to business rules: Easyminer meets Drools</article-title>
          . In Paul Fodor, Dumitru Roman, Darko Anicic, Adam Wyner, Monica Palmirani, Davide Sottara, and Francois Levy, editors,
          <source>RuleML (2)</source>
          , volume
          <volume>1004</volume>
          <source>of CEUR Workshop Proceedings. CEUR-WS.org</source>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>Radek</given-names>
            <surname>Skrabal</surname>
          </string-name>
          , Milan Simunek, Stanislav Voj r, Andrej Hazucha, Tomas Marek, David Chudan,
          <string-name>
            <given-names>and Tomas</given-names>
            <surname>Kliegr</surname>
          </string-name>
          .
          <article-title>Association rule mining following the web search paradigm</article-title>
          .
          <source>In Pete rA. Flach</source>
          , Tijl Bie, and Nello Cristianini, editors,
          <source>Machine Learning and Knowledge Discovery in Databases</source>
          , volume
          <volume>7524</volume>
          of Lecture Notes in Computer Science, pages
          <volume>808</volume>
          {
          <fpage>811</fpage>
          . Springer Berlin Heidelberg,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>