## 2 Method to Extract the Rule-Based Knowledge
### PR Generation through NAAR Mining and Prolog
#### 2.3.1 MineNAAR Algorithm  
Since the MG-CHARM algorithm basically uses a vertical transaction format, the cerebrovascular database was transformed into this format. In the horizontal format, the basic form of the dataset is presented as transaction-id in accordance with its item sets. In contrast, in vertical format, the basic form of the dataset is presented in reverse, which means that each item appears in accordance with its transaction-id. An example of the transformation dataset format applied in this study is shown in Table 3.  
After the transformation, MG-CHARM was applied to extract all FCIs and mGFCIs in the cerebrovascular examination dataset. Then, concise redundant rules were generated based on the collection of mGFCIs and their corresponding FCIs, which were further put into post-pruning procedures until a set of NAARs was generated. To obtain a set of NAARs, this study introduces an algorithm called MineNAAR which contains four main stages: (1) discovering FCIs and mGFCIs; (2) generating a set of NRARs; (3) pruning subsumption rules; and (4) extracting non-circular rules. Mining PRs from the NRAR set is non-trivial. As we explained above, ARs can be considered as PRs by pruning all rules that are anomalous, i.e., those that still contain subsumption or circular errors. This study also investigated some properties to reduce anomalies, which are contained in NRARs. The MineNAAR algorithm is described in Algorithm 1. ```
1:A cerebrovascular database \(D\), a distinct itemset \(I\), minimum support threshold \(\sigma\), and minimum confidence threshold \(\delta\). 2:\(\mathbb{R}\) is a set of NAARs. 3:procedure MineNAAR \((D,\,I,\,\delta,\,\sigma)\)
4:\(\mathcal{R}_{cur}=\varnothing\);
5:\(\{\textbf{F},\textbf{m}\textbf{G}\}=\)\(MGCHARM(D,\,I,\,\sigma)\);
6:forall\(mG_{i}\in\textbf{m}\textbf{G}\)do
7:forall\(g\in mG_{i}\
i g\
eq f,f\in\textbf{F}\)do
8:\(\mathcal{R}_{cur}=\mathcal{R}_{cur}\cup\{g\to f\backslash g,f\text{-} sup\}\);
9: Compute \(CF_{AR}\)\((\mathcal{R}_{cur})\) in \(D\);
10:endfor
11:endfor
12:\(\mathcal{R}_{sub}=\)SubsumptionCheck \((\mathcal{R}_{cur},CF_{AR},D)\);
13:\(\mathcal{R}_{cur}=\)CircularCheck \((\mathcal{R}_{sub},CF_{AR},D)\);
14:\(\mathbb{R}=\mathcal{R}_{dir}\);
15:endprocedure. ```  
**Algorithm 1** NAARs Mining \begin{table}
\begin{tabular}{c c c c} \hline \hline  & & **Item** & **TID List** \\ \hline \multirow{3}{*}{**TID**} & & a: a3 & 2,3 \\  & **Itemset** & a: a5 & 1 \\  & aa5, sdp:sdp1,..., & sdp: sdp1 & 1,2 \\  & mri:mri2 & & \\
2 & aa3, sdp:sdp1,..., & sdp: sdp2 & 3 \\  & mri:mri1 & & \\
3 & aa3, sdp:sdp2,..., & : & : \\  & mri:mri1 & & 2,3 \\  & & mri: mri2 & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: An example of transformation of the cerebrovascular examination dataset format. The first problem in MineNAAR is to remove all subsumption rules from a set of NRARs based on Definition 8. There are two main cases to reduce subsumption rules based on \(CF_{AR}\) values. A property to deal with subsumption rules is described as follows. **Property 2**. : _If there are two NRARs \(\mathcal{R}_{1}:\ X_{1}\to Y_{1}\) and \(\mathcal{R}_{2}:\ X_{2}\to Y_{2}\), which are considered to be subsumption rules according to Definition 8, then:_  
1. A NRAR can be pruned when the \(CF_{AR}\) value of one rule is lower than that of another rule;
2. A NRAR with a larger number of items in the antecedent part can be removed when \(Y_{1}=Y_{2}\) and \(CF_{AR}\left(\mathcal{R}_{1}\right)=CF_{AR}\left(\mathcal{R}_{2}\right)\) ; and
3. A NRAR with a smaller number of items in the consequent part can be pruned when \(X_{1}=X_{2}\) and \(CF_{AR}\left(\mathcal{R}_{1}\right)=CF_{AR}\left(\mathcal{R}_{2}\right)\). Based on Property 2, an algorithm to prune all subsumption rules is presented as SubsumptionCheck in Algorithm 2. ```
1:A set of concise association rules \(\mathcal{R}_{car}\), \(CF\) values of \(\mathcal{R}_{car}\), a cerebrovascular database \(D\). 2:Output:\(\mathcal{R}_{sub}\) is a set of non-subsumption NRARs.