# Recommendation Framework Combining User Interests with Fashion Trends in Apparel Online Shopping
## 3 Proposed Method
### Reflecting User's Needs  
We mentioned previously that it is important to determine which category and item-gender the user under recommendation needs. Based on user's preferences in the previous stage, we generate a final list for recommendation by additionally reflecting user's purchase intention on certain categories and the long-term interest for item-gender. Figure 6: Construction of personalized graph and adjacency matrix. (**a**) A personalized graph in \(A_{1}\) for \(u_{1}\). (**b**) An adjacency matrix for Figure 6a. Some users shop according to their purchase needs in certain categories, which leaves access logs of items in corresponding categories. Therefore, our strategy is to adjust the preference score according to the category purchase probability to improve the recommendation quality. To build a prediction model for category purchase probability from logs with three types of activities, we extract the number of daily clicks and carts for \(T\) days prior to when any purchase activity occurred, which act as predictors, and the purchase or nonpurchase of the category at the time as a dependent variable. In setting the dependent variable, whether a category is purchased or not as a binary number for a classifier yields the purchase probability of the category. Formally, let \(v_{kt}\) and \(w_{kt}\) be the daily frequencies for clicks and carts, respectively, for category \(k\) that occurred \(t\) days \((t\in\{0,1,\ldots,T\})\) prior to the purchase time, where \(t=0\) implies the purchase day. Then, the purchase probability for category \(k\), \(p_{k}\), is expressed as follows:  
\[p_{k}=f(v_{k0},w_{k0},v_{k1},w_{k1},\cdots,v_{kT},w_{kT}),\ k=1,2,\ldots,n. \tag{9}\]  
For example, by setting \(T=1\), the training data are constructed from the log in Table 1, as shown in Table 3. Notice that \(u_{2}\) did not order any item and \(u_{3}\) does not have any click and cart log for \(t=1\) (8 January 2017) and \(t=0\) (9 January 2017, the date when \(u_{3}\) ordered \(i_{6}\)) in our limited example. The former results in the activity log of \(u_{2}\) not making a training example, and the latter results in the training example of \((v_{10}=0,w_{10}=0,v_{11}=0,w_{11}=0,\ order=1)\). In Equation (9), \(f\) can be any classifier such as binary logistic regression, a random forest, or a neural network. Now, the probability that user \(u\) will purchase items in category \(k\), \(\hat{p}_{uk}\), is predicted by inputting \(\{v_{k0},w_{k0},v_{k1},w_{k1},\cdots,v_{kT},w_{kT}\}\) by user \(u\) to the trained classifier. That is, the purchase probability of \(u_{2}\) for \(A_{1}\) on 10 January 2017 in our example is \(\hat{p}_{21}=f(3,0,2,1)\). With the predicted probability \(\hat{p}_{uk}\), the final item preference score for item \(i\) contained in category \(k\) by user \(u\), \(\hat{s}_{ui}\) is calculated as follows:  
\[\hat{s}_{ui}=(1-\alpha_{2})\hat{p}_{ui}+\alpha_{2}\hat{p}_{uk},0<\alpha_{2}<1. \tag{10}\]  
Because the classification model \(f\) is trained from the user log for \(T\) recent days, if user \(u\) has no access log for category \(k\) during that time period, then \(\hat{p}_{uk}=0\). Therefore, we employ a weighted average scheme to combine item preference and purchase intention of category, instead of a multiplication-based combination method, such as the geometric mean, as applied in previous studies [14; 35]. It is also convenient to adjust the weight of each component by controlling the value of \(\alpha_{2}\). It is known that not all but most users access either women's or men's wear. Therefore, it is necessary to determine the user's interest on item-gender to minimize the loss of sales opportunity due to unnecessary item exposure. However, we would rather suggest listing both women's and men's wear than display either one set or the other, because it is still possible that the user would like to view the items of different gender. To utilize these, we adjust the proportion of women's and men's wear in our top-\(N\) recommended items.