# Recommendation Framework Combining User Interests with Fashion Trends in Apparel Online Shopping
## 3 Proposed Method
### Rating Item Clusters
Then, we cluster items for each category using the affinity propagation (AP) clustering method described in [37]. AP gradually finds exemplars and clustered data points through an iterative message passing procedure, while simultaneously regarding all data points as exemplars. One advantage is that it is not required to specify the number of exemplars in advance. Based on a real-valued similarity matrix, two types of real-valued messages, \"responsibility\" sent from other data points to candidate \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline
**User** & **Item** & **Gender** & **Category** & **\#Clicks** & **Cart** & **Order** & \(\hat{w}_{click}(k)\) & \(w_{cart}\) & \(w_{order}\) & \(r_{ui}\) \\ \hline \(u_{1}\) & \(i_{1}\) & W & \(A_{1}\) & 2 & & & 0.032 & & & 0.032 \\ \(u_{1}\) & \(i_{3}\) & W & \(A_{1}\) & 1 & & T & 0.021 & & 1 & 1 \\ \(u_{1}\) & \(i_{4}\) & W & \(A_{1}\) & 1 & & & 0.021 & & & 0.021 \\ \(u_{1}\) & \(i_{7}\) & W & \(A_{2}\) & 1 & & & 0.021 & & & 0.021 \\ \hline \(u_{2}\) & \(i_{2}\) & W & \(A_{1}\) & 3 & & & 0.049 & & & 0.049 \\ \(u_{2}\) & \(i_{3}\) & W & \(A_{1}\) & 1 & T & & 0.021 & 0.18 & & 0.18 \\ \(u_{2}\) & \(i_{5}\) & W & \(A_{1}\) & 1 & & & 0.021 & & & 0.021 \\ \hline \(u_{3}\). & \(i_{6}\) & W & \(A_{2}\) & 0 & T & 0 & & 1 & 1 \\ \(u_{3}\) & \(i_{8}\) & W & \(A_{2}\) & 1 & & & 0.021 & & & 0.021 \\ \(u_{3}\) & \(i_{9}\) & M & \(A_{3}\) & 1 & & & 0.021 & & & 0.021 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Generation of ratings by using user activities. exemplars and \"availability\" sent from candidate exemplars to other data points, are exchanged until the exemplar decisions remain constant for a given number of iterations. Its application to various fields has demonstrated that AP performs clustering with considerably lower errors in less execution time compared to other methods. After clustering items, we generate user-cluster ratings by summing all \(r_{ui}\) within a cluster. If a cluster has \(n\) items accessed by user \(u\), the rating on the cluster by user \(u\) is calculated as \(R_{uk}=\sum_{i=1}^{n}r_{ui}\). Figure 3 represents an example of the generation of a user-cluster ratings matrix based on the example data in Table 2. In this example, we assumed items are clustered as follows: \(\{i_{1},i_{2},i_{3}\}\in C_{1}\), \(\{i_{4},i_{5}\}\in C_{2}\), \(\{i_{6},i_{7}\}\in C_{3}\), and \(\{i_{8}\}\in C_{4}\). As can be seen from Figure 3, some of the cluster preferences are missing if the items in a cluster have not been assessed by the user. The missing preferences are imputed by predicted values via a user-based CF algorithm. In computing user similarities for the user-based CF, we adopt only the numerator, i.e., the inner product, from the original cosine similarity to reflect the difference in ratings. This represents the relative importance of each activity. Thus, the similarity between user \(u\) and \(v\), \(sim(u,v)\), is computed as follows:  
\[sim(u,v)=\sum_{i\in[I(u)\cap I(v)]}R_{ui}\cdot R_{ui}, \tag{4}\]  
where \(I(u)\) is a set of clusters accessed by user \(u\). For example, \(sim(u_{1},u_{2})=(1.032)\cdot(0.229)+(0.021)\cdot(0.021)\cong 0.237\) in Figure 3. Then, the predicted rating on cluster \(k\) by user \(u\), \(\hat{R}_{uk}\) is computed as follows:  
\[sim(u,v)=\sum_{i\in[I(u)\cap I(v)]}R_{ui}\cdot R_{ui}, \tag{5}\]  
where \(U\) is the set of all users. Here, we do not subtract the user's mean rating from each rating, whereas the original user-based CF does, because the cluster preference \(R_{uk}\) does not contain bias, unlike explicit ratings by users. Notice from Figure 3 that owing to data sparsity, \(f_{34}\) and \(f_{35}\) cannot be computed by user-based CF, because \(sim(u_{3},u_{1})=sim(u_{3},u_{2})=0\). After clustering items, \(\hat{R}_{32}\) can be calculated, because \(sim(u_{3},u_{1})\
eq 0\), as can be seen from Figure 3. In this way, we cope with the data sparsity problem through item clustering, computing more user similarities based on item clusters, and imputing missing preferences.