# Attention-Oriented CNN Method for Type 2 Diabetes Prediction
## 3 Materials and Methods
### Datasets
#### 3.2.1 Data Preprocessing  
In the framework proposed in this article, data preprocessing is a key step, including missing value filling, outlier replacement, feature importance analysis, data standardization and sample weight assignment. Below, we describe these steps in detail. Missing Value Padding  
Missing values [38] refer to the lack of information in the features used for prediction in the dataset. The presence of missing values affects the performance of the classifier and causes the classifier to make incorrect predictions. Furthermore, outliers in the data can  
Figure 1: Robust diabetes prediction framework proposed in this article. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**No** & **Variable** & **Describe** & **Missing Values** \\ \hline
1 & Pregnancies & Number of pregnancies & 110 \\
2 & Glucose & Blood glucose concentration 2 h & 5 \\  & & after oral administration & \\  & & of glucose & \\
3 & Blood pressure & Diastolic blood pressure & 35 \\  & & (mm Hg) & \\
4 & Skin thickness & Epidermal fold thickness & 227 \\  & & (mm) & \\
5 & Insulin & 2-h insulin serum & 374 \\  & & (mm u / mL) & \\
6 & Body mass index (weight & 11 \\  & (BMI) & expressed in kg/height m\({}^{2}\)) & \\
7 & Diabetes pedigree & Diabetes Spectrum Function & 0 \\
8 & Age & Age & 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Description of independent variables of the PID dataset. have severe impacts on analytical and statistical models, especially in data processing that requires high accuracy and reliability. Therefore, correctly handling missing values is a necessary step in the data-preprocessing process. In our study, we use average values to fill in missing values. This method can maintain the continuity of data distribution without introducing outliers and improve the performance of model classification. Specifically, it can be expressed as (1):  
\[Q(x)=\left\{ \begin{array}{rl}\text{mean }(x),&x=\text{ Null }/\text{ missed}\\ x,&x\
eq\text{ Null}\end{array} \right. \tag{1}\]  
where \(x\) represents the feature value in the sample, and we fill in the missing values by calculating the average of the non-missing values in the feature, assuming that \(x\) contains \(N\) sample instances, among which there are \(M\) non-missing values. We use \(mean(x)\) to calculate, which can be expressed as (2)  
\[mean(x)=\frac{sum(x)}{M} \tag{2}\]  
where the sum of all non-missing values in feature \(x\) is represented as \(sum(x)\). By using \(mean(x)\) to fill the position of the missing value \(x[i(M)]\), the integrity and consistency of the data can be effectively maintained. Outliers [39] are data points that are significantly different from other values in the dataset. Outliers can occur due to measurement errors, data entry errors, or extreme events. Handling outliers is a key step to ensure the robustness and accuracy of the classifier. In this article, we first use the interquartile range (IQR) to detect outliers in the dataset [40]. The principle of IQR is to calculate the difference between the first quartile and the third quartile. Specifically, it can be expressed as (3):  
\[IQR=Q3-Q1 \tag{3}\]  
where \(Q1\) and \(Q3\) represent the first quartile and the third quartile, respectively. We set the threshold to 1.5 [41] and determine the maximum and minimum values by calculating the upper and lower edges, respectively. Exceeding this score will be regarded as an outlier, which can be expressed as (4) and (5):  
\[\text{upperlimit} =Q3+(1.5\times IQR) \tag{4}\] \[\text{lowerlimit} =Q3+(1.5\times IQR) \tag{5}\]  
Feature importance analysis is an important part of data preprocessing, aiming to identify risk factors that have a significant impact on the occurrence and development of diabetes to help us better understand the mechanisms and risk factors of the disease. In this study, we use LR and analysis of variance (ANOVA) to comprehensively identify important risk factors that influence diabetes.