# Numerical Association Rule Mining from a Defined Schema Using the VMO Algorithm
## 4 Methodology
### The Proposed Approach for QM_VMO  
The procedures and techniques covered by this research can be summarized in three levels of abstraction: (i) the definition of a rule template, (ii) the generation of the rule population, and (iii) the optimization of the intervals in the numerical attributes of the rule. The activation of the first level requires user intervention and access to the dataset. Then, the definition of a rule template can be processed. At the last level, the procedures deliver the most optimal rule or set of rules as a product.  
The definition of a template is established by the user. The user configures the attributes of both the antecedent and the consequent. Using this matrix, it is possible to customize the possible combinations of attributes; this procedure is more specifically detailed in the subsection about the rule scheme.  
The estimation of the amplitude is fundamental in reaching the diversity of the population. Equation (17) is used in the procedure to achieve the mentioned goal.  
\[A_{i}=\frac{i\cdot size(N)\cdot(1-minSupp)}{size(n)} \tag{17}\]  
where \(i=1\cdots n\), \(n\) is the size of the population, and \(N\) is the number of values in the domain of the attribute. The lower and upper thresholds of the ranges are defined as follows:  
\[\begin{  
are obtained from the rule scheme \(rTest_{x}\) (line 1 in Algorithm 2). It is important to generate populations of a very good quality. For this, diversity and breadth are two criteria that are considered, and they lead to the use of procedures based on random distributions and the introduction of control variables.  
\[rTest_{j}^{k}=\bigwedge_{i=1}^{k}a_{i}\in[l_{i},h_{i}]\to b_{k}=c_{j} \tag{19}\]  
where \(k=1,\ldots,n\), \(n\) is the number of attributes, \(j=1,\ldots,m\), and \(m\) is the number of classes. So, for the achievement of a rule population from a scheme defined by Equation (19), with \(k=1\) and a value of \(j=1\) in the class, we have:  
\(R_{i}=a_{1}\in[l_{i},h_{i}]\to b_{1}=c_{1}\), where \(i=1,\ldots,n\) and \(n\) is the population size.  
\[rTest^{k}=(\bigwedge_{i=1}^{kl}a_{i}\in[l_{i},h_{i}])\rightarrow(\bigwedge_{j=1 }^{kr}b_{j}\in[l_{j},h_{j}]) \tag{20}\]  
In an entire numeric scheme, a combinatorial explosion controlled by the number of numerical attributes that make up both the LHS and RHS of the rule takes place, and several templates are generated by this process. Equation (20) shows a general way to obtain each individual in the population, where \(kl\) and \(kr\) are the numbers of attributes in the LHS and RHS, respectively.  
```
0: C,k,rTest
0: best_node
1: Generation of the rule population \(R_{i}\) with Equations (17), (19) and (20)
2:repeat
3:foreach:\(n\in N_{0}\)do
4: Find the closest \(k\) nodes using the Euclidean distance with Equation (2)
5: Select the best local node \(n_{i}^{*}\)
6:if\(n_{i}^{*}\) is better than \(n_{i}\)then
7: Calculate near factor \(Pr\) between \(n_{i}\) and \(n_{i}^{*}\) with Equation (1)
8:\(nfValues=f(n_{i};n_{i}^{*},Pr)\)
9:\(newRule=GetNewRule(nfValues)\)
10:\(n_{new}=nodeRule(newRule,nfValues)\)
11:foreach:\(n\in N_{0}\)do
12: Calculate near factor \(Pr\) between \(n_{i}\) and \(n_{g}\) and Equation (1)
13:\(nfValues=g(n_{i},n_{g},r)\)
14:\(newRule=GetNewRule(nfValues)\)
15:\(n_{new}=nodeRule(newRule,nfValues)\)
16:\(nfValues=h(n_{i},w)\)
17:\(newRule=GetNewRule(nfValues)\)
18:\(n_{frontiers}=nodeRule(newRule,nfValues)\)
19: Fill nodes in the total mesh from \(n_{frontiers}\)
20: Sort the nodes by the fitness quality in the total mesh
21: Apply the clearing operator
22: Build the mesh for the next iteration in an elitist way
23:until C iterations
24: best_node is obtained from the mesh (initial index)
25:return best_node
```  
**Algorithm 2** QM_VMO algorithm.  
Notable changes in Algorithm 2 with respect to Algorithm 1 occur in the definition of the node for an optimization structure at the intervals of the numerical attributes that make up the rule. The new values for the intervals are updated in the rule schema, and a new rule is attained.