## 2 Collaborative Filtering Algorithm Based on Personalized Privacy Protection
### Item-Item Similarity
#### 2.3.1 Similarity of the Sensitive Rating Pair  
To improve the performance of the recommendation system, we use the Bayesian algorithm to reconstruct the joint distribution of the sensitive rating pair within \(\widehat{B}\). For \(\widehat{B}^{s}_{A}\) and \(\widehat{B}^{s}_{\cdot\beta}\), \(W\) and \(\widehat{W}\) represent the collection of pre-perturbation sensitive rating pairs and the collection of post-perturbation sensitive rating pairs. \[W=\left\{\left(b^{s-}_{A},b^{s-}_{\cdot\beta}\right)\text{,}\left(b^{s-}_{A},b^ {s+}_{\cdot\beta}\right)\text{,}\left(b^{s+}_{A},b^{s-}_{\cdot\beta}\right) \text{,}\left(b^{s+}_{A},b^{s+}_{\cdot\beta}\right)\right\}\]  
\[\widehat{W}=\left\{\left(\widehat{b^{s-}_{A}},\widehat{b^{s-}_{\cdot\beta}} \right)\text{,}\left(\widehat{b^{s-}_{A}},\widehat{b^{s+}_{\cdot\beta}} \right)\text{,}\left(\widehat{b^{s+}_{A}},\widehat{b^{s-}_{\cdot\beta}} \right)\text{,}\left(\widehat{b^{s+}_{A}},\widehat{b^{s+}_{\cdot\beta}} \right)\right\}\]  
The joint distribution estimation algorithm based on Bayesian algorithm is shown as follows. First, initialize the rating pairs in \(W\) to be uniformly distributed, then calculate the prior probability through Bayesian method, i.e.,  
\[P\Big{(}\widehat{w}\in\widehat{W}\Big{|}w\in W\Big{)}=\prod_{i=1}^{len(w)}p^{ w[i]\widehat{w}[i]\widehat{w}[i]}\times q^{1-w[i]\widehat{w}[i]} \tag{5}\]  
where \(p\) and \(q\) represent the random flip probability, respectively; \(\text{len}(w)\) denotes the number of elements in the collection of \(w\); \(w[i]\), and \(\widehat{w[i]}\) represent the \(i\)-th element in the collections of \(w\) and \(\widehat{w}\), respectively. Furthermore, iteratively update the value of the posterior probability estimation for \(W\), i.e.,  
\[P_{iter}\Big{(}w\Big{|}\Big{(}\widehat{b^{s-}_{\text{\emph{i}}a}},\widehat{b^ {s}_{\text{\emph{i}}\beta}}\Big{)}\in\widehat{W}\Big{)}=\frac{P_{iter}(w) \times P\Big{(}\widehat{b^{s-}_{\text{\emph{i}}a}},\widehat{b^{s-}_{\text{ \emph{i}}\beta}}\Big{|}w\Big{)}}{\sum_{t\in W}P_{iter}(t)\times P\Big{(}\widehat {b^{s-}_{\text{\emph{i}}a}},\widehat{b^{s-}_{\text{\emph{i}}\beta}}\Big{|}t \Big{)}} \tag{6}\]  
\[P_{iter+1}(w\in W)=\frac{\sum_{u\in IU^{s}(\alpha,\beta)}P_{iter}\Big{(}w\Big{|} \Big{(}\widehat{b^{s-}_{\text{\emph{i}}a}},\widehat{b^{s-}_{\text{\emph{i}} \beta}}\Big{)}\in\widehat{W}\Big{)}}{N_{IU^{s}(\alpha,\beta)}} \tag{7}\]  
where \(iter\) represents the times of iterations. In addition, the algorithm stops iterating under the following condition, i.e.,  
\[\max_{W}P_{iter}(w\in W)-\max_{W}P_{iter-1}(w\in W)\leq\delta \tag{8}\]  
Figure 3: Perturbation matrix \(\widehat{B}\). where \(\delta\) is used to control the number of iterations. Finally, Algorithm 1 outputs the Bayesian estimation distribution \(P(w\in W)\). According to \(P(w\in W)\), the similarity of the sensitive rating pair can be obtained as follows, i.e.,  
\[sim_{1}=P\Big{(}w=\left(\widehat{b_{\alpha}^{s-}},\widehat{b_{\alpha}^{s-}} \right)\Big{)}+P=\left(\left(\widehat{b_{\alpha}^{s+}},\widehat{b_{\alpha}^{s +}}\right)\right) \tag{9}\]  
```
Input: \(p\); \(\widehat{B_{\alpha}}\), \(\widehat{B_{\beta}}\); \(W\),\(\widehat{W}\); \(IU^{s}(\alpha,\beta)\) Output: \(P(w\in W)\)
1. Initialize \(P_{0}(w\in W)=0.25\);
2. for w in \(W\)
3. for \(\widehat{w}\) in \(\widehat{W}\)
4. Calculate the prior probability \(P(\widehat{w}|w)\) according to Formula 5;
5. end for
6. end for
7. Initialize \(iter=0\); // The number of iteration executions
8. while \((\underset{W}{\max}P_{iter}(w\in W)-\underset{W}{\max}P_{iter-1}(w\in W)>\delta)\)
9. for \(u\) in \(IU^{s}(\alpha,\beta)\)
10. for \(w\) in \(W\)
11. Calculate the posteriori probability \(P_{iter}\Big{(}w\Big{|}\left(\widehat{b_{\alpha}^{s}},\widehat{b_{\alpha\beta} ^{s}}\right)\in\widehat{W}\Big{)}\) according to Formula 6;
12. end for
13. end for
14. Calculate \(P_{iter+1}(w\in W)\) according to Formula 7;
15.