# A Cardiovascular Disease Risk Score Model Based on High Contribution Characteristics
## 2 Materials and Methods
### XGBoost Histogram Model  
By comparing four machine learning models:logistic regression [20], linear support vector machine [21], random forest [22], XGBoost [23], we validated the algorithm based on the Kaggle competition cardiovascular disease dataset and chose XGBoost, which had the highest accuracy, as the base model. As XGBoost uses a pre-ranking method to handle node splitting, although the splitting points calculated in this way are more accurate. However, the training time in use is long and the memory usage is large. In this paper, the XGBH model is proposed as a fast high-performance gradient enhancement framework, a tree-based learning algorithm [24]. XGBH introduces a histogram algorithm based on XGBoost, by which the introduction of this algorithm can reduce the number of features in the sample and save memory space.  
The basic idea of the Histogram algorithm is to discretize the data by partitioning the continuous feature values into k boxes. The feature histogram is constructed using the k discrete boxes. Instead of traversing all the sample points to find the segmentation points, the algorithm looks between the boxes, speeding up the process and reducing memory. Instead of losing accuracy it will have the effect of regularisation and improve the generalisation ability of the algorithm. The specific implementation process is as Algorithm 1:  
\begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline
**Variable Type** & **Feature** & **Value Type** & **Feature Meaning** \\ \hline \multirow{4}{*}{Objective} & Age & int (days) & count in days \\  & Height & int (cm) & count in centimeters \\  & Weight & float (kg) & count in kilograms \\  & BMI & float (kg/m\({}^{2}\)) & Body mass index \\  & Gender & categorical code & 1: women, 2: men \\ \hline \multirow{4}{*}{Examination} & Ap\_hi & int (mmHg) & Systolic blood pressure \\  & Ap\_lo & int (mmHg) & Diastolic blood pressure \\  & & & Cholesterol 1: normal, 2: \\  & Chol & categorical code & above normal, 3: well above \\  & & & normal \\  & Gluc & categorical code & Glucagons 1: normal, 2: above \\  & & & normal, 3: well above normal \\ \hline \multirow{4}{*}{Subjective} & Smoke & binary & whether patient smokes or not \\  & Aclo & binary & Alcohol intake \\ \cline{1-1}  & Active & binary & Physical activity \\ \hline \multirow{2}{*}{Target variable} & Cardio & binary & Presence or absence of \\ \cline{1-1}  & BMI = Height/(Weight * Weight). & & cardiovascular disease \\ \hline \end{tabular}
\end{table}
Table 1: Characteristics of the dataset.  
From the algorithm: the histogram optimisation algorithm needs to pre-transform the feature values into bin values before training, make a segmentation function on the values of the features, divide the values of all samples on that feature into a certain segment (bin), and finally discrete the values of the features.  
Where H[f.bins[i]].g is the sum of the gradients of the samples in each bin, H[f.bins[i]].n is the number of samples in each bin, \(S_{L}\), \(S_{R}\), \(S_{P}\) represents the gradient sum on the left side of the current bin, the gradient sum on the right side, and the total gradient sum, \(n_{L}\), \(n_{R}\), and \(n_{P}\) represent the number of samples on the left side, the right side and the total number of samples.