# A Random PRIM Based Algorithm for Interpretable Classification and Advanced Subgroup Discovery
## 2 Related Works
### The Patient Rule-Induction Method
#### 2.1.2 PRIM's Evaluation Metrics  
When evaluating a box, there are four metrics to analyze: the support, the coverage, the density, and the dimension of the box. The first statistic is the coverage. It is the proportion of the target cases (cases of interest) that are in the box compared to the total number of target cases in the dataset. The mathematical expression is as follows:  
\[\textit{coverage}=\frac{Number\;of\;target\;points\;in\;the\;box}{Total\;number\;of\; target\;points\;in\;the\;dataset} \tag{4}\]  
The starting point of PRIM is the unrestricted full set of cases, which includes all outcomes of interest, and, therefore, the coverage starts at one and drops as the algorithm progresses. If the coverage of a box is high, it means that the box captures a larger fraction of the target cases, and, thus, it identifies the behavior of interest. If the coverage is low, it can lead to more precise and actionable insights, but it may also miss out on broader patterns or be applicable to only a limited set of cases. The coverage helps to evaluate the effectiveness of the box in isolating the desired patterns or responses within the dataset. Figure 3: Example of a categorical box. Figure 2: Example of a numeric box. The second important statistic is the support. The support of a box is the fraction of points from the dataset that fall into the box. In the prim package on Python, it is referred to as _mass_, and mathematically it is expressed as:  
\[mass=\frac{Number\ of\ points\ in\ the\ box}{Total\ number\ of\ points\ in\ the\ dataset} \tag{5}\]  
The \"mass\" aids in determining the size of the box. A higher mass denotes a greater amount of data contained in the box, which means it is less specific but more general, whereas a lower mass indicates a smaller amount of data captured, hence focusing more on a subset that meets the criteria defined by the box. This statistic is crucial for comprehending the trade-off between the box's specificity and coverage when locating intriguing areas within the data space. The third statistic to evaluate a box is the density of the box. The density is the equivalent of the confidence in PRIM. It measures how concentrated the target cases are within the box, providing insight into the purity of the box concerning the target cases. Since with PRIM we deal with rectangles or hyper-rectangles, the density makes more sense. The expression of the density is as follows:  
\[density=\frac{Number\ of\ target\ points\ in\ the\ box}{Total\ number\ of\ points\ in\ the\ box} \tag{6}\]  
If the density is high, it means that a larger proportion of the points in the box are target cases, suggesting that the box is well-targeted and specific to the desired behavior or outcome. Conversely, a lower density suggests that the box includes a significant number of non-target cases, making it less precise. The last measurement is the restricted dimensions, or res dim, found in the Python _prim_ package. The quantity of variables that define a box is indicated by this measure. It is helpful to evaluate the box's complexity and comprehend the number of features that go into identifying the target cases inside the box, as this gives insight into the patterns that are produced and their interpretability and specificity. The relationships between mass, density, and coverage in PRIM are critical to comprehending how well a box captures the target cases. The density shows the concentration of those target cases within the box, indicating how pure the box is, whereas the coverage measures the percentage of target cases that are included within the box relative to all target cases in the dataset. There is a trade-off between capturing many targets and retaining specificity; a box with high coverage captures many target cases, but its density may be low if it also includes many non-target cases. Conversely, the mass indicates the percentage of the total dataset that the box contains, including both target and non-target cases.