# A Random PRIM Based Algorithm for Interpretable Classification and Advanced Subgroup Discovery
## 3 Proposed Methodology
### Illustrative Example  
To illustrate the functioning of R-PRIM-CI, we used the Iris dataset in Python. The low dimensionality, balanced classes, and ease of use of the Iris dataset make it a popular choice for quick experimentation and visualization of classifiers. Also, it is a good dataset to guide the users through the example. It offers a useful test of a classifier's capacity to discern between three different but somewhat overlapping classes. Its compact size makes it ideal for learning and fine-tuning algorithms because it enables rapid training and testing. This dataset is a trustworthy standard for evaluating new classifiers because of its extensive documentation and popularity in the machine-learning community. This makes it a great place to start before working with more complicated datasets, as in Section 4. We used the _prim_ package in Python with additional functions that we developed to select random features and create matrices that contain the final results. For an illustrative purpose, we set the prediction at setosa (1) or not setosa (0). The detailed steps for R-PRIM-CL to predict if a flower is a Setosa are as follows:  
1. **Initialization step** 1. A set of **150 flowers from the Iris dataset** 2. A set of **four numeric variables as X = {sepal length (cm), sepal width (cm), petal length (cm), petal width (cm)} 3. Y being a three class labels target, we coded setosa as 1 and _versicolor and virginica_ as 0, hence Y \(\in\) {0, 1} 4. Define minimum **support, peeling, and pasting** thresholds: **s = 10%, \(\alpha\) = 5%, \(\beta\) = 5%**
2. **Procedure** 1. Random choice of the feature search spaces by the algorithm: [_'sepal length (cm)','sepal width (cm)'], ['sepal length (cm)', 'petal width (cm)'], ['sepal width (cm)', 'petal length (cm)', 'petal width (cm)'],  
Figure 6: Illustration of the construction and the validation of the classifier after the obtention of all the rules. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Index** & **Box** & **Coverage** & **Density** & **Res Dim** & **Mass** \\ \hline R1 & 4.3 \(<\) sepal length (cm) \(<\) 5.35 AND 2.95 \(<\) sepal width (cm) \(<\) 4.4 & 0.78 & 1.00 & 2 & 0.26 \\ \hline R2 & 4.3 \(<\) sepal length (cm) \(<\) 5.45 AND 2.15 \(<\) sepal width (cm) \(<\) 4.4 & 0.15 & 0.50 & 2 & 0.10 \\ \hline R3 & 3.349 \(<\) sepal width (cm) \(<\) 4.4 & 0.08 & 0.38 & 1 & 0.07 \\ \hline R4 & 4.3 \(<\) sepal length (cm) \(<\) 5.95 AND 0.1 \(<\) petal width (cm) \(<\) 0.8 & 1.00 & 1.00 & 2 & 0.33 \\ \hline R5 & 1.0 \(<\) petal length (cm) \(<\) 3.75 AND 0.1 \(<\) petal width (cm) \(<\) 0.8 & 1.00 & 1.00 & 2 & 0.33 \\ \hline R6 & 1.0 \(<\) petal length (cm) \(<\) 1.79 & 0.95 & 1.00 & 1 & 0.32 \\ \hline R7 & 3.25 \(<\) sepal width (cm) \(<\) 4.4 AND 1.0 \(<\) petal length (cm) \(<\) 6.05 & 0.05 & 0.25 & 2 & 0.07 \\ \hline R8 & 1.0 \(<\) petal length (cm) \(<\) 3.75 AND 0.1 \(<\) petal width (cm) \(<\) 0.8 & 1.00 & 1.00 & 2 & 0.33 \\ \hline R9 & 4.3 \(<\) sepal length (cm) \(<\) 7.35 AND 0.1 \(<\) petal width (cm) \(<\) 2.25 & 0.90 & 0.35 & 2 & 0.86 \\ \hline R10 & 3.05 \(<\) sepal width (cm) \(<\) 4.05 AND 1.35 \(<\) petal length (cm) \(<\) 5.85 & 0.45 & 0.49 & 2 & 0.31 \\ \hline R11 & 4.3 \(<\) sepal length (cm) \(<\) 7.80 AND 3.05 \(<\) sepal width (cm) \(<\) 4.05 & & & & \\ \hline R12 & 6.55 \(<\) sepal length (cm) \(<\) 7.80 AND 2.15 \(<\) petal width (cm) \(<\) 2.5 & 0.10 & 0.44 & 2 & 0.08 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The final boxes retained for the classifier. 2. The set of selected rules from the metarules pruning step (_R1_, _R4_, _R5_, _R6_, _R8_) with R4_, _R5_ and _R8_ covering the same data and R6 include in R8_ 3. The final box measures: coverage, density, support, and dimension _Ex: R1 (coverage = 78%, density = 100%, support = 26%, dimension = 2)_ 4.