# Heart Failure Prediction Based on Bootstrap Sampling and Weighted Fusion LightGBM Model
## 4 Experimental Settings
### Data Set Generation
#### 4.1.3 Initial Data Exploration  
(1) Data distribution  
The target variable of the data set is HeartDisease, which indicates whether the patient has heart disease. The following pie chart mainly shows the proportion of patients with heart disease in the sample data. As can be seen from the Figure 2, the proportion of patient users is 55.3%, and the proportion of non-patient users is 44.7%, which belongs to a balanced data set and does not need to be balanced. Figure 2: Proportional diagram of heart failure. The influence of various indicators on the predicted value  
In order to explore the relationship between these attributes and HeartDisease, a number of attributes in the data set, such as age, sex, chest pain type, cholesterol, fasting blood sugar, resting blood pressure, and maximum heart rate, were analyzed visually. The basic information of patients is age and gender, respectively. By drawing a nuclear density estimation map to compare the age distribution of people with and without heart disease, to observe the possible correlation between age and heart disease, it is found that the proportion of middle-aged and elderly patients is high, especially at the age of 60 in Figure 3a. By drawing a bar chart to analyze the situation of people with and without heart disease in different sexes, it is found that the probability of male patients is greater than that of female patients in Figure 3b. Indicators of symptoms related to chest pain include the chest pain type and exercise-induced angina. The distribution of people with and without heart disease in different types of chest pain and the relationship between exercise-induced angina and whether they have heart disease are used to explore the relationship between chest pain-related symptoms and heart disease. There are four types of chest pain, among which, TA stands for typical angina pectoris, ATA stands for atypical angina pectoris, NAP stands for non-anginal Pain, and ASY stands for asymptomatic chest pain. Through analysis, it is found that the proportion is large when the type of chest pain is ASY, and there is no obvious chest pain, but the probability of exercise-induced angina is high in Figure 4.  
Blood biochemical indexes include serum cholesterol and fasting blood sugar. Through the construction of nuclear density estimation maps, the distributions of serum cholesterol  
Figure 4: The influence of symptoms related to chest pain on the predicted value: (**a**) the influence of chest pain types and (**b**) the influence of exercise-induced angina. Figure 3: The influence of basic patient information on the predicted value: (**a**) the influence of age and (**b**) the influence of sex. and fasting blood glucose levels were compared between individuals with and without heart disease. In addition, based on the visualization results, the potential relationship between cholesterol levels and heart disease was studied. It is found that the probability of becoming sick is high when serum cholesterol is around 0 and 250, and it is high when fasting blood sugar is 1 in Figure 5.  
The physiological indexes include resting blood pressure and maximum heart rate. The distribution of resting blood pressure (RestingBP) and maximum heart rate (MaxHR) between people with heart disease and those without heart disease were compared by drawing the nuclear density estimation map. With the help of visual images, the relationship between them and heart disease is analyzed. It is found that the resting blood pressure is around 150, and the maximum heart rate is around 125 in Figure 6.  
The physical examination indexes include resting electrocardiogram, oldpeak and the slope of the peak exercise ST segment. We attempted to analyze whether there is any connection between the resting electrocardiogram, oldpeak, and the slope of the peak exercise ST segment and the heart disease from the visual results.