# Recommendation Framework Combining User Interests with Fashion Trends in Apparel Online Shopping
## 3 Proposed Method
### Personalized Random Walk  
In this subsection, we describe the stage for scoring item preferences, which consists of three steps: Generating a base graph, personalizing the graph, and scoring item preferences through random walks. We begin with constructing a directed graph with items as nodes and the number of transitions as edge weights; this is called a unity graph. From the sequential click data in Table 1, the transitions by \(u_{1}\) for \(A_{1}\) on 9 January 2017 are expressed as \((i_{1},i_{4})\), \((i_{4},i_{3})\), and \((i_{3},i_{1})\) in the form of (source node, target node). Figure 4a,b depicts the directed graphs for \(u_{1}\) and \(u_{2}\), respectively. In succession, the integration of the two graphs by summing edge weights on the same transition results in the unity graph shown in Figure 4c. Here, we define a unity graph from the entire click data generated for one day, which represents the item click flow of the day. The base graph is created by sequentially integrating the unity graphs such that the graph represents the trend of the latest item selection. We initially set the oldest unity graph as a base graph and repeatedly update the base graph on a daily basis, using a temporal weighting scheme. Let \(w_{old}(x,y)\) be an edge weight from node \(x\) to node \(y\) in the latest base graph, which was updated yesterday, and \(w_{0}(x,y)\) be an edge weight in a unity graph of today, which is not yet reflected in the base graph. Then, the edge weight in the updated base graph, \(w_{new}(x,y)\), is calculated as follows:  
\[w_{new}(x,y)=\max\{\tau\cdot w_{old}(x,y),\;w_{0}(x,y)\},\;0<\tau<1. \tag{6}\]  
By setting a unity graph on 9 January 2017 in Figure 4c as an initial base graph and applying \(\tau=1/e\), an updated base graph on 10 January 2017 is created as shown in Figure 5. Notice that the new edge weight from \(i_{1}\) to \(i_{4}\) on the updated base graph on 10 January 2017 is \(w_{new}(i_{1},i_{4})=\max\Bigl{\{}\frac{1}{e},0\Bigr{\}}=\frac{1}{e}\). Figure 4: Construction of unity graph for \(A_{1}\) on 9 January 2017. (**a**) A directed graph for \(u_{1}\) on 9 January. Figure 5: Construction of base graph on 10 January 2017. (**a**) A unity graph on 9 January. (**b**) A unity graph on 10 January. (**c**) A base graph on 10 January. In Equation (6), any change in the new edge weight is sensitively reflected in the new base data by decreasing the previous edge weight. In addition, we take the maximum of the two weights instead of the sum to provide items with different sales periods with a fair standard by reflecting the click data for one day for each weight. Therefore, the base graph represents not only the latest item popularity, but also the rich connectivity for long-tail items. For reference, the recommendation of related items for a given item is easily derived in this step by sorting the target nodes of outgoing edges from a given node according to their edge weights. In the next step, a personalized graph is created by combining the user's preferences on clusters, \(R_{uk}\), with the edge weight on the base graph, \(w_{new}(x,y)\). Let \(C_{k}\) be an item set contained in cluster \(k\). Then, a personalized edge weight from \(x\) to \(y\in C_{k}\) for user \(u\), \(w_{u}(x,y)\) is defined as follows:  
\[w_{u}(x,y)=(1-\alpha_{1})\cdot w_{new}(x,y)+\alpha_{1}\cdot R_{uk},\ y\in C_{k }\ and\ 0<\alpha_{1}<1. \tag{7}\]  
Figure 6a illustrates a personalized graph in \(A_{1}\) for \(u_{1}\). It was created from the base graph in Figure 5c. The preferences of \(u_{1}\) on \(C_{1}\) and \(C_{2}\) are \(R_{11}=1.032\) and \(R_{12}=0.021\), respectively, and \(\alpha_{1}=0.5\) was chosen in this example. Therefore, the edge weight from \(i_{5}\) to \(i_{2}\in C_{1}\) becomes \(w_{1}(i_{5},i_{2})=(1-0.5)\times 1+0.5\times 1.032=1.016\) and that from \(i_{2}\) to \(i_{5}\in C_{1}\) is updated to \(w_{1}(i_{2},i_{5})=(1-0.5)\times 1+0.5\times 0.021=0.511\).