# Mining Top-\(k\) High Average-Utility Sequential Patterns for Resource Transformation
## 3 Mining Top-\(k\) High Average-Utility Pattern  
In this section, several definitions are introduced to explain the framework of TKAUS. Table 1 shows an example. Consider a set of distinct items \(I=\{i_{1},i_{2},\cdots,i_{M}\}\), \(X\) is a nonempty subset of \(I\), denoted as \(X\subseteq I\), and \(|X|\) represents the size of \(X\). A sequence \(S:\langle X_{1},X_{2},\cdots,X_{m}\rangle\) is an ordered list of itemsets, where \(X_{k}\subseteq I\), \((1\leqslant k\leqslant m)\). The length of \(S:\langle X_{1},X_{2},\cdots,X_{m}\rangle\) is calculated as \(l=\sum_{k=1}^{m}|X_{k}|\), and is called \(l\)-sequence. The size of \(S:\langle X_{1},X_{2},\cdots,X_{m}\rangle\) is \(m\). Assume that there exists integers \(1\leqslant j_{1}<j_{2}<\cdots<j_{n}\leqslant m\) such that \(X_{q^{\prime}}\subseteq X_{j_{q^{\prime}}}\), \((1\leqslant v\leqslant n)\), the sequence \(S:\langle X_{1},X_{2},\cdots,X_{m}\rangle\) has a subsequence \(s:\langle X_{1}^{\prime},X_{2}^{\prime},\cdots,X_{n}^{\prime}\rangle\), notated as \(S\supseteq s\) or \(s\subseteq S\). The definitions of the quantitative sequence and the quantitative sequence database have been proposed in [48]. A quantitative sequence database consists of quantitative sequences (\(q\)-sequences). The \(q\)-sequence is an ordered list of the quantitative itemset (\(q\)-itemset). The quantitative item (\(q\)-item) is expressed in the form of (item, quantity) and denoted as (\(i\),\(q\)). In the tuple, the quantity of the item is represented by the internal utility value of the item. In Table 1, \(Q_{1}\) is an identifier of \(q\)-sequence, and it is unique. **Definition 1** (Q-item Utility). : _Consider a \(q\)-item \((i\):\(q_{i})\) in the \(j\)th \(q\)-itemset within a \(q\)-sequence \(Q\), the \(q\)-item utility is denoted as \(u(i,j,Q)\) and is calculated as follows:_  
\[u(i,j,Q)=q(i,j,Q)\times eu(i)\]  
_where \(eu(i)\) is the external utility of the item \(i\), and \(q(i,j,Q)\) is the internal utility of the item \(i\) and is a quantitative measure for the \(q\)-item._  
**Definition 2** (Q-itemset Utility). : _Let \(Y:\{(i_{1}\text{:}q_{1})(i_{2}\text{:}q_{2})\cdots(i_{n}\text{:}q_{n})\}\) is a \(q\)-itemset and is the jth \(q\)-itemset in a \(q\)-sequence \(Q\). The \(q\)-itemset utility is the sum of the \(q\)-item utilities. It is denoted as \(u(Y,j,Q)\) and is calculated as follows:_  
\[u(Y,j,Q)=\sum_{u=1}^{n}q(i_{u},j,Q)\times eu(i_{u})\]  
The profit of the item as the external utility values is provided in Table 2. For example, as Definition 1, consider the 3 rd \(q\)-itemset of \(Q_{2}\) in Table 1, the utility of \(q\)-item \(d\) is \(q(d,3,Q_{2})\times eu(d)=3\times 2=6\). Then, we have the utility of the 3 rd \(q\)-itemset in \(Q_{2}\) is calculated as \(u(Y,3,Q_{2})=u(c,3,Q_{2})+u(d,3,Q_{2})+u(e,3,Q_{2})+u(g,3,Q_{2})=8+6+7+8=29\). \(D\) represents the \(q\)-sequence database in Table 1, and the overall utility of \(D\) is \(u(D)=123+56+63+59+73=374\). **Definition 3** (Q-itemset Average Utility). : _Let \(Y\):\(\{(i_{1}\text{:}q_{1})(i_{2}\text{:}q_{2})\cdots(i_{n}\text{:}q_{n})\}\) is the jth \(q\)-itemset in a \(q\)-sequence \(Q\). Its average utility is denoted as \(au(Y,j,Q)\) and is calculated as follows:_  
\[au(Y,j,Q)=\frac{\sum_{u=1}^{n}q(i_{u},j,Q)\times eu(i_{u})}{|Y|}=\frac{\sum_{u =1}^{n}q(i_{u},j,Q)\times eu(i_{u})}{n}\]  
For instance, in Table 1, \(\{a,c\}\) is the 1 st \(q\)-itemset in \(Q_{1}\), the average utility of \(\{a,c\}\) is calculated as \(au(\{a,c\},1,Q_{1})=\frac{(4\times 1)+(2\times 8)}{2}=10\). **Definition 4** (Match). : _Consider the \(q\)-itemset \(Y\):\(\{(i^{\prime}\text{:}q_{1})(i^{\prime}\text{:}q_{2})\cdots(i^{\prime}\text{:}q _{n})\}\) and the itemset \(X\):\(\{i_{1},i_{2},\cdots,i_{n}\}\), if and only if \(n=m\) such that \(i^{\prime}_{k}=i_{k}\), \((1\leqslant k\leqslant m=n)\), we say that \(X\) matches \(Y\) or \(Y\) matches \(X\), denoted as \(X\sim Y\) or \(Y\sim X\).