## 3 Materials and Methods
### Similarity Measures
#### 3.2.1 Indirect and Direct Distance Metrics  
Rule distances that are obtained from data are called Indirect Distance Metrics, which are defined as a function of the market-basket sets that support two considered rules. For the purpose of clustering association rules, [PERSON] and [PERSON] introduced a measure called \"tightness\", which emphasizes the strength of the correlation between the items of an association rule. The premise of this technique is that correlated items tend to occur together in transactions. \"Tightness\" is different from traditional support or confidence measures. More precisely, the support values for the most and least frequent items of an association rule were considered for computing the distance. Let \(x_{1}x_{2}\ldots x_{m}\rightarrow\cdots\ldots x_{n}\) be an association rule and the \(\ldots=1\ldots n\) its respective items. \(S_{x_{i}}\) denotes the support of item \(x_{i}\). Support values for the most and least -frequent items of association rule \(r\) are given by \(S_{r_{\max}}=\max(S_{\_,\_,\_,\_},\ldots,S_{\_}{x_{\_}n})\) and \(S_{\_}{r_{\min}}=\min(\ldots,\ldots,S_{\_}{x_{\_}n})\). The tightness measure is defined as follows:  
\[T=\frac{S_{\_}r}{\left(\frac{S_{\_}{\max}+S_{\_}{r_{\_}{\min}}}{2}\right)-S_{\_ }r}\]  
\(T\) reaches its maximum (i.e., \(\infty\)) when \(S_{\_}{r_{\_}{\max}}+S_{\_}{r_{\_}{\min}}=S_{\_}r\). Based on the notion of tightness, the following distance measure has been introduced:  
\[d(r_{\_}1,r_{\_}2)=\frac{|T_{\_}{r_{\_}1}-T_{\_}{r_{\_}2}|}{T_{\_}{r_{\_}1}+T_ {\_}{r_{\_}2}}\]  
As [PERSON] and [PERSON] have shown in the context of market basket analysis, this measure is able to discover similar purchasing behaviors in different item domains and is appropriate for association rules. In connection with association rule mining, ref. [39] presented their approach to mitigating the rule quantity problem with pruning and grouping techniques. They proposed clustering the rules by introducing the following simple distance measure based on database coverage between association rules with the same consequence. The distance \(d^{AMBD}\) between _rule_1 and _rule_2 is the (estimated) probability that one rule does not hold for a basket, given that at least one rule holds for the same basket. Based on the number of non-overlapping market baskets, a distance metric can be defined as follows:  
\[d^{AMBD}_{\_}{rule1,rule2}=m(BS_{\_}{rule1})+m(BS_{\_}{rule2})-2*|m(BS_{\_} {rule1},BS_{\_}{rule2})| \tag{4}\]  
where \(BS\) is both sides of the rule; that is, the itemset for the association rule. \(m(BS)\) denotes the support of a rule. In Equation (4), rules with similar tuples obtain a lower distance than the rules with dissimilar tuples. More specifically, the distance indicates the percentage of tuples in the dataset that are not covered by either rule. This approach, while intuitive and applicable only for rules with the same consequent, is appropriate for measuring the similarity of class association rules. Since the rules are clustered by class label, the distance is computed by ignoring the class label. When applying indirect distance metrics to our proposed method, a larger number of clusters is found, meaning the classifiers included a large number of rules. This issue was a research motivation to propose a new normalized distance metric based on \"direct\" measures, called Item Based Distance Measure (IBDM), in this research paper by considering the differences in rule items. Let \(R:\ \{a_{\_}1,a_{\_}2,\ldots,a_{\_}n\}\Rightarrow C\) be a class association rule where, \(a_{\_}i\), \((i=1\ldots n)\) is rule items (attributes' values), \(n\) is the total number of attributes (the number of rule items cannot exceed \(n\)), and \(C\) is a class label. Given two rules _rule_1: \(\{a_{\_}1,a_{\_}2,\ldots,a_{\_}m\}\Rightarrow C\), \(rule2:\ \{a_{\_}1,a_{\_}2,\ldots,a_{\_}k\}\Rightarrow C\). _rule_1, \(rule2\in R\) and \(1\leq m\), \(k\leq n\), we compute the similarity as follows:  
\[similarity(index)=\left\{