# Attention-Oriented CNN Method for Type 2 Diabetes Prediction
## 4 Results
### Data-Preprocessing Results  
#### 4.1.1 Missing Value Padding and Outlier Imputation  
We identify outliers in the PID dataset and NHANES dataset and process them using the median replacement method. The results are shown in Figure 5a. We can see that in the PID dataset, the features \"pregnancy\", \"blood pressure\", \"skin thickness\", \"insulin\", \"BMI\", \"diabetes spectrum function\" and \"age\" are affected by outliers. Compared with deleting outliers, the method of using median replacement can retain the integrity and sample size of the data without affecting the consistency of other features, and can maintain the distribution characteristics and trends of the data. This replacement method improves the robustness and consistency of the data and improves the performance of the classifier. Therefore, replacing outliers with the median is an effective way to deal with outliers. In the processed PID dataset, the box plot after using the median to replace outliers is shown in Figure 5b. Similarly, in the NHANES dataset as shown in Figure 5c, the features \"systolic blood pressure\", \"diastolic blood pressure\", \"weight\", \"body mass index\", \"hemoglobin\", \"albumin\", \"ALP\", \"AST\", \"ALT\", \"cholesterol\", \"creatinine\", \"GGT\", \"iron\", \"LDH\", \"phosphorus\", \"bilirubin\", \"protein\", \"uric acid\", \"HDL\" and \"glycated hemoglobin\" are affected by outliers. After using the method of replacing outliers with medians to process the NHANES dataset, the box plot is shown in Figure 5d. In this way, we handle the outliers and present box plots of the processed dataset.  
Figure 6 uses the kernel density estimation (KDE) function to show in detail the overall distribution of features in the PID dataset and the NHANES dataset before and after data preprocessing. Before preprocessing as shown in Figure 6a,c, the data features present a significant skewed distribution, being both left and right skewed. This distribution skewness may lead to low expected value estimates. In addition, some features also show obvious multimodality. After data preprocessing as shown in Figure 6b,d, the skewness of the feature distribution is significantly improved, the mean and median are closer, and the multimodality phenomenon is basically eliminated. This shows that data preprocessing significantly optimizes the statistical properties of the data and provides a more stable foundation for subsequent analysis work. As shown in Figure 7, we also construct correlation heatmaps for each PID and NHANES dataset. By qualitatively and quantitatively analyzing (a) and (c), and (b) and (d) in Figure 8, we find that the Pearson correlation coefficient between variables in the dataset is significantly enhanced after handling outliers  
Figure 5: Boxplots before and after outlier processing in the PID dataset and NHANES dataset, where (**a**) is the box plot of the PID dataset before outlier processing, (**b**) is the box plot of the PID dataset after outlier processing, (**c**) is the box plot of the NHANES dataset before outlier processing, and (**d**) is the box plot of the NHANES dataset after outlier processing.  
and filling missing values. Taking the PID dataset as an example, the Pearson correlation coefficients between the variables \"blood pressure\", \"skin thickness\" and \"insulin\" and the outcome variables are increased significantly compared with the correlation before data preprocessing.  
Figure 6: Overall distribution diagram of attributes of PID dataset and NHANES dataset. Among them (**a**) is the overall distribution of features before data preprocessing in the PID dataset, and (**b**) is the overall distribution of features after data preprocessing in the PID dataset, (**c**) is the overall distribution of features before data preprocessing in the NHANES dataset, and (**d**) is the overall distribution of features after data preprocessing in the NHANES dataset.