## 4 Proposed HTPR Method
### Online Recommendation  
In this section, the process of searching the set of nearest neighbor users and making rating prediction is introduced, and an online recommendation for the target user was created.  
The search scope will be too small if nearest neighbors are only selected from the cluster that has the highest similarity with the target user without regard to other clusters. Therefore, the outcome of clustering cannot be assumed to be optimal. For this reason, a proxy user is defined as the cluster center of each cluster. Firstly, we calculated the similarity between the proxy user and the target user, and then defined a threshold of similarity and select eligible clusters. Finally, the set of nearest neighbors was obtained from these clusters.  
Through user clustering, \(n\) users were divided into \(k_{2}\) clusters, i.e., \(U_{1},U_{2},\ldots,U_{k_{2}}\) where \(U_{1}\cup U_{2}\cup\ldots\cup U_{k_{2}}=U\) and \(U_{i}\cap U_{j}=\varnothing\) (\(i,j\in[1,k_{2}]\)). Assuming that the user \(u\) was the target user, we calculated the similarity of the user \(u\) and its neighbor user. To obtain the neighbor user set, the Pearson correlation was used to measure the similarity,  
\[sim(u,v)=\frac{\sum\limits_{i\in E_{uv}}\left(R_{u,i}-\overline{R_{u}} \right)\cdot\left(R_{u,i}-\overline{R_{v}}\right)}{\sqrt{\sum\limits_{i\in E _{uv}}\left(R_{u,i}-\overline{R_{u}}\right)^{2}}\cdot\sqrt{\sum\limits_{i\in E _{uv}}\left(R_{u,i}-\overline{R_{v}}\right)^{2}}} \tag{15}\]  
where \(v\) is a candidate neighbor user; \(E_{uv}\) denotes the union set of items rated by the user \(u\) and the user \(v\) as well; \(\overline{R_{u}}\) and \(\overline{R_{v}}\) are respectively the average ratings given by the user \(u\) and the user \(v\).  
Algorithm 3 illustrates the algorithm to search for a neighbor user set.  
Here, we use a weighted average approach to predict the personalized rating of an item for the target user.  
\[PR_{u,j}=\overline{R_{u}}+\frac{\sum\limits_{v\in KNN(u)}sim(u,v)\cdot(R_{v,j}- \overline{R_{v}})}{\sum\limits_{v\in KNN(u)}sim(u,v)} \tag{16}\]  
where \(sim(u,v)\) is the similarity of the target user \(u\) and the neighbor user \(v\) in neighbor user set \(KNN(u)\); \(\overline{R_{u}}\) and \(\overline{R_{v}}\) are respectively the average ratings given by the user \(u\) and the user \(v\) in user-item rating matrix with feature supplemented, i.e.,\(FR=\left(R_{i,j}\right)_{n\times m}\); \(R_{v,j}\) denotes the rating of the user \(v\) for the item \(j\).  
Once the set of nearest neighbor users was obtained, the rating of all candidate items for the target user was predicted based on the historical ratings of \(K\) neighbor users, and the candidate items were sorted according to the predicted ratings. Finally, a personalized service recommendation list (Top-\(N\) list) was generated and the most appropriate items were recommended to the target user.  
Note that most of the operations of HTPR are processed offline. During the online recommendation phase, we only need to accomplish missions including nearest neighbor searching, rating prediction and recommendation, which can achieve a high quality of recommendation service. On the other hand, in the offline phase, feature information and the result of item clustering and user clustering would be updated periodically. To be specific, the newly produced data of items and users will also be updated into the database for feature input and clustering model updating.