# Research of Personalized Recommendation Technology Based on Knowledge Graphs
## 5 Experiment
### KG-BPR Model and KG-NN Model
#### 5.2.2 KG-BPR Experiment Results and Analysis  
We first observe the influence of the feature dimension d on KG-BPR model. We set dimension d to 20, 40, 60, 80, 100, and 120. We set N of the TOP-N recommendation model to 100, which means 100 movies are recommended for each user. We set the learning rate of the improved TransE model to 0.01. The regularization coefficient of the entities and relations vector is set to 0.1. The learning rate of the KG-BPR model is set to 0.01. The regularization coefficient of the user feature matrix and the movie feature matrix is set to 0.01. Furthermore, the maximum number of iterations is 1000. The ratio of the training set and test set is 7:3. The experimental results are shown in Table 4 and Figure 14.  
It can be seen from Table 4 that when the dimension d is 40, the KG-BPR model has the best effect and the MAP value is the largest, which is 0.04807176. Through comparison, it can be found that due to the introduction of knowledge graphs in KG-BPR model, the MAP value of the KG-BPR model is improved in any feature dimension and the recommendation effect is better compared with BPR model. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Model** & **MeanRank Value** & **hits@10 Value** \\ \hline TransE model & 229.21078 & 0.81862 \\ Improved TransE model & 189.50092 & 0.86336 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of MeanRank value and hit@10 value before and after improvement. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Number of Users** & **Number of Movies** & **Number of Ratings** & **Data Density** \\ \hline
6040 & 3382 & 756,684 & 3.704\% \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Information of MovieLens-1M dataset. During the experiment, we found that after introducing the movie entity vector generated by the knowledge graphs, the number of iterations required for the model to achieve the optimal effect is greatly reduced. Therefore, we set the dimension d to 40 and observe the effect of the KG-BPR model as the number of iterations increases. The experimental results are shown in Figure 15. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Feature Dimension d** & **KG-BPR Model MAP Value** & **BPR Model MAP Value** \\ \hline
20 & 0.04735185 & 0.04632617 \\
40 & 0.04807176 & 0.04506615 \\
60 & 0.04802097 & 0.04605486 \\
80 & 0.04767749 & 0.04557344 \\
100 & 0.04781234 & 0.04514578 \\
120 & 0.047412 & 0.04507794 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: MAP values of models in different dimensions. Figure 14: The MAP value of the model in different dimensions. Figure 15: Effect diagram of MAP value changing with iteration times. It can be seen from Figure 15 that the MAP value of the KG-BPR model has stabilized after about 40 iterations, while the BPR model needs to be iterated about 150 times before it stabilizes. Therefore, the introduction of the movie entity vectors speeds up the training of model parameters. Furthermore, it can assist the model to generate user feature matrices and movie feature matrices for recommendation faster and better. Finally, we compared the KG-BPR model with other models. The comparison results of the MAP value of the model are shown in Table 5. Among them, NMF and SVD are implemented using the Python-based open source library SupriseLib. The MAP value in Table 5 is when the N value is 100 in the Top-N recommendation. It can be seen that using the semantic information of the item itself efficiently and introducing the auxiliary information of the knowledge graphs, KG-BPR model effectively improves the performance of the recommendation. It produces a high-quality recommendation list, and greatly improves the ranking effect in the recommendation list. Finally, we compared the KG-NN model with other models. The comparison result of the model accuracy is shown in Table 8. The reason why the KG-NN model only compares the precision with other models is that the recall rate of this model may be slightly lower than that of the model to be compared.