# About Rule-Based Systems: Single Database Queries for Decision Making
## 4 Stages in the Design of a Rule-Based Database System
### \(STEP\) 1 in Detail-Discussion of Selected Rule Generation Techniques
#### 4.1.3 Minimal Sets of Rules: LEM2  
The methods consist in searching for the smallest set of rules representing the most common patterns in data. An illustrative technique is LEM2 (Learn from Examples by Modules 2) introduced by [PERSON] [7; 17; 18]. LEM2 is based on a general heuristic principle, cf, [PERSON]'s AQ [19], [PERSON]'s CN2 [20], or PRISM, [PERSON] [21], by which, rule descriptors are selected based on an established criterion (e.g., frequency) and rule-covered objects removed from consideration. We only remember to include them always in the rule support. The calculation is continued until the system is covered by rules, or until there are completely contradictory combinations in the system.  
The LEM2 set of rules from the Table 2 is as follows:  
* \((Humidity=Normal)\&(Wind=Weak)=>(Play\_Tennis=Yes[4])\)
* \((Weather=Overcast)=>(Play\_Tennis=Yes[4])\)
* \((Humidity=High)\&(Weather=Sunny)=>(Play\_Tennis=No[3])\)
* \((Weather=Rain)\&(Wind=Strong)=>(Play\_Tennis=No[2])\)
* \((Temperature=Mild)\&(Weather=Rain)\&(Humidity=High)\&(Wind=Weak)=>(Play\_Tennis=Yes[1])\)  
In order to present the effectiveness of the techniques described in the section, we conducted a demonstration experiment using the RSES system on selected data from UCI Repository [3]-see Figure 2.  
Let us present samples of real rules and related statistics, generated from the heart disease system [3]. The meaning of the individual attribute names [3]: \(attr0=age\), \(attr1\ sex\), \(attr2=chest\)\(path\)\(type\), \(attr3=resting\)\(blood\)\(pressure\), \(attr4=serum\)\(cholesterol\)\(in\)\(mg/dL\), \(attr5=fasting\)\(bloodsougar>120\)\(mg/dL\), \(attr6=resting\)\(electrocardiographic\)\(results\), \(attr7=maximum\)\(heart\)\(rate\)\(achieved\)\(attr8=exercise\)\(induced\)\(angina\), \(attr9=oldpeak\), \(ST\)\(depression\)\(induced\)\(by\)\(exercise\)\(relative\)\(to\)\(rest\)\(,attr10=the\)\(slope\)\(of\)\(the\)\(peak\)\(exercise\)\(ST\)\(segment\), \(attr11=number\)\(of\)\(major\)\(vessels\)\((0\)-\(3)\)\(colored\)\(by\)\(fluovospy\), \(attr12=thal:\)\(3=normal\)\(;6=fixed\)\(defect\)\(;7=reversable\)\(defect\).  
Using the defined notation of \(attr1,...,attr12\)\(attributes\) of the rules, an example of the most supported exhaustive rules is in Table 3-based on RSES tool [5]. A similar example for the LEM2 algorithm can be seen in Table 4. And finally for the sequential covering technique in Table 5.  
\begin{table}
\begin{tabular}{c} \hline (attr1=0)\&(attr5=0)\&(attr6=0)\&(attr12=30)=>(attr13=1[32]) \\ (attr1=0)\&(attr2=30)\&(attr12=30)=>(attr13=1[29]) \\ (attr1=0)\&(attr6=0)\&(attr10=10)=>(attr13=1[26]) \\ (attr2=40)\&(attr6=20)\&(attr10=20)\&(attr12=70)=>(attr13=2[25]) \\ (attr1=0)\&(attr6=0)\&(attr8=0)\&(attr11=0)=>(attr13=1[25]) \\ (attr1=0)\&(attr2=30)\&(attr11=0)=>(attr13=1[24]) \\ (attr2=20)\&(attr5=0)\&(attr10=10)\&(attr12=30)=>(attr13=1[22]) \\ (attr1=0)\&(attr5=0)\&(attr8=0)\&(attr10=20)\&(attr12=30)=>(attr13=1[20]) \\ (attr1=0)\&(attr2=30)\&(attr10=10)=>(attr13=1[20]) \\ \end{tabular}
\end{table}
Table 3: Examples of real rules-exhaustive algorithm, Statlog (heart) Data Set [3], Rule statistics: 5352 rules, Support of rules Minimal: 1, Maximal: 32, Mean: 1.7, Length of rule premises, Minimal: 1, Maximal: 6, Mean: 2.6, Distribution of rules among decision classes, Decision class 1: 2732, Decision class 2: 2620.