# Quality-Aware Resource Model Discovery
## 3 Quality-Aware Resource Model Discovery
### Integrated Model Construction  
In the last two sections, we explained how to produce case-annotated transition systems and identify the superior and inferior cases based on event logs. The following phase integrates the results from the last two steps. In other words, quality-based superior and inferior paths are established on the discovered resource model. First, we calculate _SCs_ ratio (_SCR_) and _ICs_ ratio (_ICR_) for each state and event, showing how many superior cases or inferior cases are included among all the instances, respectively. These two values become the materials to evaluate the performance of states and events. Formally, _SCR_ and _ICR_ are defined as follows.  
**Definition 4**.: _(SCs ratio, ICs ratio)Let \(L\) be an event log, and \(\text{CTS}=(S,E,T,A^{s},A^{e})\) be a case-annotated transition system based on the log \(L\). Let \(S\), \(I\) be the set of the superior and the inferior cases, respectively. SCs ratio for states \(\text{SCR}^{s}\) and events \(\text{SCR}^{e}\) and ICs ratio for states \(\text{ICR}^{s}\) and events \(\text{ICR}^{e}\) are defined as follows._  
\[-\text{SCR}^{s} =\sum\limits_{s\in S}\frac{\sum_{c\in\mathcal{C}^{s}(s)}\begin{cases} 1&if,\,c\in S\\ 0&otherwise\\ \end{cases}}{-\text{ICR}^{s}} =\sum\limits_{c\in E}\frac{\sum_{c\in\mathcal{C}^{s}(s)}\begin{cases} 1&if,\,c\in I\\ 0&otherwise\\ \end{cases}}\]  
The performance of states and events is assessed using two measurements: _Between sum_ (i.e., _BWS_) and _Between difference_ (i.e., _BWD_). _BWS_ is calculated by summing up both _SCs_ ratio and _ICs_ ratio for a specific state or an event. It refers to the paramountcy of the state or the event itself. After that, _BWD_ is employed to identify whether a particular state or an event belongs to the superior paths or the inferior paths. If _BWD_ is greater than 0, i.e., \(\text{SCR}>\text{ICR}\), the relevant state or event is determined as the part of the superior paths that lead to a high quality. In the opposite case, i.e., \(\text{SCR}<\text{ICR}\), it is considered as a piece of the inferior paths. Based on the case-annotated transition system, an integrated model is constructed by incorporating _BWS_ and _BWD_, such that _IM_ = (_CTS_, _BWS_, _BWD_). These are defined as follows.  
**Definition 5**.: _(BW sum_, _BW difference_, _Integrated model_) Let _SCR_\({}^{s}\) and _SCR_\({}^{e}\) the superior case ratio for states and events, respectively. Let _ICR_\({}^{s}\) and _ICR_\({}^{e}\) the inferior case ratio for states and events, respectively. BW sum for states _BWS_\({}^{s}\) and events _BWS_\({}^{s}\) and _BW difference for states _BWD_\({}^{s}\) and events _BWD_\({}^{e}\) are defined as follows.  
\[-BWS^{s}=BCR^{s}+WCR^{s}\] \[-BWS^{e}=BCR^{s}+WCR^{e}\] \[-BWD^{s}=BCR^{s}-WCR^{s}\] \[-BWD^{e}=BCR^{e}-WCR^{e}\]  
_Let BWS and BWD be the set of BW sum and BW difference, respectively. Then, an integrated model IM = (CTS_, _BWS_, _BWD_) is the case-annotated transition system including BWS and BWD._  
Note that _BWS_ and _BWD_ values are utilized to visualize the derived model's border and arcs. By comparing _BWS_ and _BWD_ with user-defined thresholds, the superior and the inferior paths can be painted differently. As a result, users can quickly recognize the meaningful paths in the model. Details are provided in Section 4.2.