# Quality-Aware Resource Model Discovery
## 3 Quality-Aware Resource Model Discovery
### Superior and Inferior Case Identification  
In this section, we give a detailed explanation of how to identify the superior cases, i.e., _SCs_, and the inferior cases, i.e., _ICs_, based on the quality values. To this end, it is necessary to employ a couple of statistical functions. First, we verify the normality of the empirical distribution for quality values from the event logs. In accordance with the result, the corresponding step to obtain _SCs_ and _ICs_ is separated. As a method to test the normality, we employ the _Kolmogorov-Smirnov one sample test_[22], i.e., KSIS. It investigates whether the empirical quality distribution from the log and the normal distribution are statistically the same or not. The test statistic \(D\) is \(sup_{x}|F_{n}(X)-F(X,\mu,\sigma)|\), where \(F_{n}(X)\) is the empirical cumulative distribution and \(F(X,\mu,\sigma)\) is the cumulative normal distribution. The null (\(H_{0}\)) and the alternative (\(H_{1}\)) hypothesis are established such that \(F_{n}(X)=F(X,\mu,\sigma)\) and \(F_{n}(X)\
eq F(X,\mu,\sigma)\), respectively. If normality is satisfied, QCs and ICs are determined based on the mean (\(\mu_{Y}\)) and the standard deviation (\(\sigma_{Y}\)) of the quality distribution. Conversely, when the normality condition is unsatisfactory, the median (\(M_{Y}\)) and the median absolute deviation (\(MAD_{Y}\)) [23] values are utilized. Based on the calculated mean/median and the standard deviation/MAD, we can create a certain range that represents just a mediocre quality, i.e., \(\mu_{Y}-w\times\sigma_{Y}\leq\beta_{y}(c)\leq\mu_{Y}+w\times\sigma_{Y}\) or \(M_{Y}-w\times MAD_{Y}\leq\beta_{y}(c)\leq M_{Y}+w\times MAD_{Y}\), where \(w\) is a user-specified weight. After that, the quality values of all cases are evaluated whether they are within or outside the range. If the quality values are higher than the maximum value of the range, the corresponding cases are classified as _SCs_. On the other hand, if cases have a lower quality than the minimum value of the range, they belong to _ICs_.  
Algorithm 1 explains the proposed approach to identify the superior and inferior cases in detail.  
```
Input  An event \(\log L\)  A weight to specify mediocre range of quality \(w\) Output  A set of cases that have relatively high quality (i.e., _the superior cases_) \(S\)  A set of cases that have relatively low quality (i.e., _the inferior cases_) \(I\)  Let \(C\) be the set of cases in an event \(\log L\) and \(\beta_{q}(c)\) be the quality value for a case \(c\in C\). \(KSIS\) is the function to conduct the Kolmogorov-Smirnov one sample test for identifying whether a sample follows the normal distribution or not. _Average, Stdve, and Median_ are functions to calculate average, standard deviation, and median values of a specific distribution, respectively. \(Q\)\(\big{\{}\beta_{q}(c)|c\in L\big{\}}\) \(normality\_result\)\(\leftarrow\)\(KSIS(Q)\) \(S\leftarrow\varnothing\), \(I\leftarrow\varnothing\) ifnormality_result is True then \(\mu_{Q}\leftarrow\)Average(\(Q\)) \(\sigma_{Q}\leftarrow\)Stddev(\(Q\)) \(S\leftarrow\big{\{}c\in L|\beta_{q}(c)\geq\mu_{Y}+w\times\sigma_{Q}\big{\}}\) \(I\leftarrow\big{\{}c\in L|\beta_{q}(c)\leq\mu_{Y}-w\times\sigma_{Q}\big{\}}\) else \(M_{Q}\leftarrow\)Median(\(Q\)) \(b\gets\)\(1/q(0.75)\) (where, \(q(0.75)\) is the \(0.75\) quantile of the distribution) \(MAD_{Q}\gets\)\(b\times\)Median\(\big{\{}|\beta_{q}(c)-M_{Q}|\)\(|c\in L\big{\}}\) \(S\leftarrow\big{\{}c\in L|\beta_{q}(c)\geq M_{Q}+w\times MAD_{Q}\big{\}}\) \(I\leftarrow\big{\{}c\in L|\beta_{q}(c)\leq M_{Q}-w\times MAD_{Q}\big{\}}\) return\(S\), \(I\)
```  
**Algorithm 1**_IdentifyingSlases(L, \(w\))_