# Boosting the Learning for Ranking Patterns
## 5 Running Example  
To demonstrate our approach, we utilize an initial set of patterns \(\mathcal{P}=\{P_{1},\ldots,P_{10}\}\), along with a user ranking \(r_{\texttt{w}_{\texttt{w}}}\), and five interestingness measures \(\mathcal{M}=\{M_{1},\ldots,M_{5}\}\). The user ranking for \(\mathcal{P}\), rankings given by \(M_{i}\) on \(\mathcal{P}\), and the AHPRank results are presented in the columns of Table 1. It is important to note that none of the measures perfectly match the user ranking (column _user_).  
The data presented in Table 1 is utilized by our algorithm to construct the AHP matrix and learn the weight vector \(w\) over the set of interestingness measures \(\mathcal{M}=\{M_{1},\ldots,M_{5}\}\). For simplicity, we refer to the AHP algorithm in the passive mode with \(\mathcal{S}=\{S_{a}=\langle P_{3},P_{1},P_{5},P_{2},P_{4}\rangle\}\). In this case, the user's ranking order is \(P_{3}\triangleright_{u}P_{1}\triangleright_{u}P_{5}\triangleright_{u}P_{2} \triangleright_{u}P_{4}\). AHP learns the weights by invoking learnWeights on \(S_{a}\) and computing the correlation between the user rankings of \(S_{a}\) and the rankings of the measures \(M_{i}\). The matrix in (8) shows the \(\Delta\) values for each measure pair. It is worth noting that no two measures perfectly match the user ranking (column _user_) for the pattern set \(\mathcal{P}\).  
To compute \(\Delta_{1,2}(S_{a})\), we need to calculate Kendall's W \(K_{1}(S_{a})\) (resp., \(K_{2}(S_{a})\)) between the ranking of \(M_{1}\) (resp., \(M_{2}\)) and the user ranking \(S_{a}\). The value of \(\Delta_{1,2}(S_{a})\) is given by \((K_{1}(S_{a})-K_{2}(S_{a}))\), which in this case is \((0.25-0.25)=0\). After scaling the values of \(\Delta\) to \((-9\cdot\cdots-1)\) for negatives and \((1\ldots 9)\) for positives, we can observe from Equation (8) that measure \(M_{5}\) is better than \(M_{4}\) with a degree of 6. The same degree of preference is observed between \(M_{5}\) and \(M_{3}\), while \(M_{3}\) and \(M_{4}\) are indifferent.  
\[\Delta=\begin{subarray}{c}(M1)\\ (M2)\\ (M3)\\ (M4)\\ (M5)\end{subarray}\left(\begin{array}{ccccc}(M1)&(M2)&(M3)&(M4)&(M5)\\ &0&0.42&0.42&-0.43\\ &&0.20&0.28&-0.25\\ &&&-0.08&-0.55\\ &&&&-0.60\end{array}\right)\overset{Scaling}{\longrightarrow}\begin{subarray}{c }(M1)\\ (M2)\\ (M3)\\ (M4)\\ (M5)\end{subarray}\left(\begin{array}{ccccc}(M1)&(M2)&(M3)&(M4)&(M5)\\ &1&4&4&-4\\ &&2&3&-3\\ &&&1&-6\\ &&&&-6\\ \end{array}\right) \tag{8}\]  
Afterwards, the learnWeights function in AHPRank computes the AHP matrix \(A\) using the scaled \(\Delta\) matrix (i.e., the average correlation gap) as input:  
\[\textbf{A}=\begin{subarray}{c}(M1)\\ (M2)\\ (M3)\\ (M4)\\ (M5)\\ \end{subarray}\left(\begin{array}{ccccc}(M1)&(M2)&(M3)&(M4)&(M5)\\ &1&1&4&4&1/4\\ 1&1&2&3&1/3\\ 1/4&1/2&1&1&1/6\\ 1/4&1/3&1&1&1/6\\ 4&3&6&6&1\end{array}\right) \tag{9}\]  
At the end, AHPRank computes the weighting vector \(w\) by solving a minimization problem. The learned weight vector \(w=(w_{M_{1}},w_{M_{2}},w_{M_{3}},w_{M_{4}},w_{M_{5}})\) is \((0.24,0.24,0.065,0.065,0.39)\), reflecting the importance of each measure for achieving the goal of the user ranking function \(g_{w}\).  
Using the AHP interestingness measure \(g_{w}\) from Equation (6), we can rank all patterns in \(\mathcal{P}\) provided in Table 1. AHPRank achieves an overall ranking accuracy of 91% in this example, correctly ranking the first five patterns, the seventh, and the tenth ones.  
\begin{table}
\begin{tabular}{c c c c c c c c c c c c} \hline \hline
**User** & \(\mathcal{S}\) & \(\boldsymbol{M_{1}}\)**–_Rank_ & \(\boldsymbol{M_{2}}\)**–_Rank_ & \(\boldsymbol{M_{3}}\)**–_Rank_ & \(\boldsymbol{M_{4}}\)**–_Rank_ & \(\boldsymbol{M_{5}}\)**–_Rank_ & \(\boldsymbol{g_{w}}\)**–_Rank_ \\ \hline
**1** & \(P_{7}\) & 0.95 & **1** & 0.48 & 8 & 0.79 & 2 & 0.30 & 9 & 0.80 & **1** & 0.72 & **1** \\
**2** & \(P_{3}\) & 0.75 & 3 & 0.72 & 1 & 0.78 & 3 & 0.70 & 2 & 0.61 & **2** & 0.68 & **2** \\
**3** & \(P_{6}\) & 0.80 & 2 & 0.49 & 7 & 0.50