# Heart Failure Prediction Based on Bootstrap Sampling and Weighted Fusion LightGBM Model
## 4 Experimental Settings
### Data Set Generation
#### 4.1.4 Data Preprocessing  
Feature discretization  
Because the quantitative units of each variable in the data set are different, the dimension of the Oldpeak feature is quite different compared with other features. In order to eliminate the influence of different dimensions, it is divided into four grades, normal, mild abnormality, moderate abnormality, and severe abnormality, according to medical knowledge. When Oldpeak is less than or equal to 0.2 mV, it may indicate that the ST segment depression of the heart is at a normal or near normal level. When Oldpeak is greater than 0.2 mV and less than or equal to 0.4 mV, it can be classified as mild abnormality. If Oldpeak is greater than 0.4 mV and less than or equal to 0.6 mV, it can be classified as moderate anomaly. When Oldpeak is greater than 0.6 mV, it is a serious anomaly.  
Feature encoding  
Some binary variables in the data set, such as Sex and ExerciseAngina, are transformed into numerical variables by simple mapping, so that the subsequent models can handle them. The purpose of this transformation is to make the model understand and process the classification information and bring it into the calculation in numerical form.  
For the classification features in data with multiple category attributes, such as Chest-PainType, RestingECG, and ST_Slope features, there are many values, and the values can  
Figure 7: The influence of physical examination indexes on the predicted values: (**a**) resting electrocardiogram; (**b**) the influence of oldpeak, and (**c**) the influence of the slope of the peak exercise ST segment.  
not be distinguished in size, nor can we know whether they are good or bad. Therefore, for the classification features ChestPainType, RestingECG, and ST_Slope, label encoding processing is used for data format conversion. After label encoding, all feature variables within the data set are transformed into numerical values. This transformation not only facilitates the processing of input data by computer learning algorithms but also enables the expansion of the sample's feature variables.  
In the data preprocessing part, data standardization and dimension reduction are not carried out. The reason is that the tree models such as LightGBM and XGBoost are insensitive to the size of data. In the process of building a tree model, decisions are made mainly according to the split points of features, without relying on the specific values of features. The decision-making process of decision trees, gradient lifting decision trees, and other models is also based on the sorting and comparison of features, not the absolute value of features. In addition, features in the data set have different physical meanings, and standardization may destroy the original information and internal relations of these features. For example, heart rate and blood pressure are two characteristics with different orders of magnitude and physical meanings. Forced standardization may cover up their unique correlation with heart disease, making it difficult for the model to capture the real law. The number of data features is relatively limited (11 features are used), and there is no obvious dimension disaster problem. The following feature selection section will analyze the basis of feature preservation in detail.