## 3 Proposed Method
### Optimizing the Weights of Time Contextual Factors  
It is assumed that a user's channel preference can be described by combining the defined time contextual matrices, \(U^{u}\), \(D^{u}\), \(H^{u}\), and \(T^{u}\). That is, the preference of user \(u\) for channel \(c\) at time \(t\), such that \(m_{u,c,t}\) can be defined as follows:  
\[m_{u,c,t}=w^{u}_{U}\cdot U^{u}_{c}+w^{u}_{D}\cdot D^{u}_{s_{D,c}}+w^{u}_{H} \cdot H^{u}_{s_{H,c}}+w^{u}_{T}\cdot T^{u}_{s_{T,c}}, \tag{3}\]  
where \(S_{D}\), \(S_{H}\), and \(S_{T}\) are the time slot of day, hour, and day-hour matrix that include time \(t\). \(w^{u}_{U}\), \(w^{u}_{D}\), \(w^{u}_{H}\), and \(w^{u}_{T}\) are the weights of each matrix. For example, the preference of user \(u\) for channel 1 at 1:30 a.m. on Monday can be defined as the linear combination of \(U^{u}_{c_{1}}\), \(D^{u}_{\text{Mon},c_{1}}\), \(H^{u}_{1-2h,c_{1}}\), and \(T^{u}_{\text{Mon}:1-2h,c_{1}}\). If the weights of matrices \(w^{u}_{U}\), \(w^{u}_{D}\), \(w^{u}_{H}\), and \(w^{u}_{T}\) are 0.1, 0.2, 0.3, and 0.4, respectively, \(m_{u,c_{1},(1:30\text{ A.M. on Monday})}\) can be calculated as follows:  
\[ \begin{array}{ll}m_{u,c_{1},(1:30\text{ A.M. on Monday})}&=0.1\times 0.3+0.2 \times 0.1+0.3\times 0.2+0.4\times 0.0\\ &=0.11\end{array}  \tag{4}\]  
Figure 1: An example of a user’s time-aware channel preferences: (**a**) usual matrix composed of only channels, (**b**) day matrix composed of channels and days, (**c**) hour matrix composed of channels and hours, and (**d**) day-hour matrix composed of channels and days-hours. Since the weight of the day-hour context is higher than any others, we can say that the user tends to choose TV channels under the day-hour context than other time contextual factors. Similarly, the preference on genres is defined using time contextual matrices, \(U^{u}\), \(D^{u}\), \(H^{u}\), \(T^{u}\), and their weight parameters, \(v^{u}_{U}\), \(v^{u}_{D}\), \(v^{u}_{H}\), and \(v^{u}_{T}\) as follows:  
\[m_{u,g,t}=v^{u}_{U}\cdot U^{u}_{g}+v^{u}_{D}\cdot D^{u}_{s_{D,g}}+v^{u}_{H}\cdot H ^{u}_{s_{H,g}}+v^{u}_{T}\cdot T^{u}_{s_{T,g}} \tag{5}\]  
In order to find each user's optimal weight parameters \(w^{u}\)'s and \(v^{u}\)'s, a QP technique is used, which is a kind of constrained optimization method. The parameters for channels and genres, \(w^{u}\)'s and \(v^{u}\)'s, are optimized separately with similar QP formulas. If user \(u\) watched channel \(c\) at time \(t\), it can be considered that user \(u\) most preferred channel \(c\) at time \(t\). This means that the preference score of channel \(c\) at time \(t\) must be higher than those of the other channels. This consideration can be formulated as simple inequality constraints. The best weights can be defined as ones that minimize the violation of those constraints for all the viewing records in user \(u\)'s history. The optimal values of weight parameters are found by solving the following constrained optimization problem. The following is for weights of channel preferences, \(w^{u}\)'s. \[\underset{w^{u}_{U},w^{u}_{D},w^{u}_{H},w^{u}_{T}}{\operatorname{ argmin}}\sum_{i,c}\varepsilon^{2}_{u,i,c}\] (6) subject to \[w^{u}_{U}+w^{u}_{D}+w^{u}_{H}+w^{u}_{T}=1\] \[w^{u}_{U}\geq 0,\;w^{u}_{D}\geq 0,w^{u}_{H}\geq 0,\;w^{u}_{T}\geq 0\] \[\varepsilon_{u,i,c}\geq 0\] \[m_{u,c_{i},i_{i}}\geq m_{u,c,i_{i}}-\varepsilon_{u,i,c}\] \[\text{for }i=1,\cdots,l,\;c=1,\cdots,q\text{ and }c\
eq c_{i}\]  
\(\varepsilon\)'s are slack variables to be minimized. The total number of channels is \(q\) and the length of user \(u\)'s watching history is \(l\). \(t_{i}\) and \(c_{i}\) are the viewing time and channel of the \(i\)th record in user \(u\)'s watching history. Especially, this optimization process does not require any external information because it only needs a target user's viewing logs. However, if there are many records in a user history, the optimization process can be very slow because the constraints in the formula will increase proportionally to the number of records and the time complexity of QP is \(O\) (\(n^{3}\)).