# Privacy-Preserving Data Analytics in Internet of Medical Things
## 5 Proposed Method for Privacy Preservation in Healthcare Data
### Experimental Results on the Breast Cancer Prediction Dataset  
In this implementation, we compared the difference between the actual count and differential private outcome. First, we imported a CSV file of the Breast Cancer Prediction Dataset into IPython Jupyter Notebook Version 6.4.8 (It is developed by the Project Jupyter team, the project originated at Stanford University in the United States). After this, we performed multiple queries on the data to extract the counts of patients in different age groups during mammography with true values for history of breast biopsy. Figure 4 shows the actual counts of patients in different age groups without applying differential privacy.  
Figure 5 shows the counts of patients in different age groups during mammography with true values of history of breast biopsy after applying differential privacy. Differential privacy was implemented through PyDP using the Laplace mechanism. The experiment was performed by selecting different values for epsilon; here, the selected value for epsilon is \(\varepsilon\) = 0.2.  
Figure 6 displays a comparison between true values and differentially private values by setting \(\epsilon=0.2\). The Y axis shows the counts of patients in different age groups during mammography with true value of history of breast biopsy, and the X axis shows patient age groups. To provide a more intuitive idea of the precision of our estimations, we computed the ratios between the actual and estimated values. For instance, for the 60-70 patient age group, for which the actual value is 5088 and the estimated value is 5081, the ratio can be calculated as follows:  
\[\text{Ratio}=\frac{\text{Actual Value}}{\text{Estimated Value}}=\frac{5088}{5081} \approx 0.999\]  
This shows that our estimate has a high degree of accuracy and is relatively close to the actual values. The ratio of the 60-70 age group of approximately 0.999 shows that the estimated value (5081) is nearly identical to the actual value (5088), suggesting that our estimation method performs exceptionally well for this group. With a ratio of the 70-80 age group of about 0.992, the estimate (3035) is slightly lower than the actual value (3057), indicating a minor discrepancy. This still reflects a strong performance, and the ratio of the 80-90 group of approximately 0.996, again, indicates high accuracy, with the estimated value (911) being very close to the actual value (915). Overall, the high ratios across the majority of age groups show that our estimation method is robust and strong, effectively capturing actual values with a small margin of error. The bias is calculated as the difference between the actual value and the estimated value for each age group. A positive bias indicates overestimation, while a negative bias indicates underestimation.  
The mean squared error can be calculated using the following formula:  
\[\text{MSE}=\frac{1}{n}\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2}\]  
Sum of Squared Errors:  
Figure 4: Actual counts without DP.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**No. of Patients** & **Actual Results** & **DP Results** & **Bias** \\ \hline Patients between age 60 and 70 & 5088 & 5081 & \(-7\) \\ \hline Patients between age 70 and 80 & 3057 & 3035 & \(-22\) \\ \hline Patients between age 80 and 90 & 915 & 911 & \(-4\) \\ \hline Patients between age 90 and 100 & 0 & 3 & 3 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Comparison of actual results and DP results.