## 4 Healthcare Knowledge Management Systems
### High Blood Pressure Diagnosis Support
#### 4.1.1 Decision Tree for High Blood Pressure Detection  
Training Phase  
Preprocessing: The text data have a lot of empty data, zero value data, and even non-viable values that will affect the operations of the knowledge layer. Therefore, data preprocessing will remove non-viable values from the dataset. The solution to empty data fields is filling values using mathematical interpolation. This dataset is saved as a csv extension file and put on HBase for later use in distributed environments. We label the data records based on the diagnosis results, which are concluded by professional doctors with high reliability. The data record is labeled 1 if the patient is diagnosed with high blood pressure and 0 otherwise. After labeling, we process the string information in the dataset to build a feature extraction model and receive the feature vectors. Model training: We fit a decision tree with a ratio of 70/30 for training and testing phases. A classification decision tree is built with the train set, and then we will use the test set to evaluate the model performance. Table 2 contains the information of the dataset after labeling and feature extraction. This information is obtained during the steps we take before dividing train/test sets. In addition, based on the trained model, we use the featureImportances function supported by PySpark library to select variables that have an important influence on the disease diagnosis in the dataset. The importance of a variable is weighted by Gini-importance defined by the total decrease in node impurity. It is calculated by the number of samples that reach the node, divided by the total number of samples. The higher the value, the more important the feature is. We can rely on this result to remove unimportant data fields to reduce training time as well as increase the accuracy of the model. The results we obtained from the featureImportances are shown in Figure 8.  
We decided to remove two unimportant data fields (head circumference and chest circumference) and retrain the models with the dataset consisting of only 11 data fields. We train different decision tree models by varying the tree depth as well as performing the training phase in a distributed environment with three proposed scenarios. \begin{table}
\begin{tabular}{l l l l l l} \hline
**Symptoms** & **Diagnosis** & **Label** & **Index** & **Symptoms Classification** & **Features** \\ \hline Headache, vomit & Intracranial Injury & 0 & 194 & (25,152,[194],[1,0]) & (25,163), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 205], [17, 100, 0, 60, 80, 180, 157, 22, 53, 84, 80, 70, 10] \\ \hline Fever & Chikappone & 0 & 7 & (25,152,[7],[1,0]) & (25,163), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 18], [1, 36, 140, 60, 60, 78, 20, 17, 39, 68, 50, 39, 10, 10] \\ \hline Trend & Hypertension & 1 & 1 & (25,152,[1],[0]) & (25,163), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12], [49, 20, 1040, 1040, 22, 17, 40, 58, 80, 37, 10] \\ \hline Abdominal pain & Acute appendicitis & 0 & 0 & (25,152,[0],[1,0]) & (25,163), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [23, 10, 110, 70, 87, 20, 146, 40, 50, 40, 37, 10] \\ \hline Duzzy & Vestibular dysfunction; Hypertension 1 & 4 & (25,152,[4],[1,0]) & (25,163), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15], [1, 53, 10, 70, 100, 840, 18, 0, 15, 42, 55, 50, 37, 10, 140] \\ \hline \end{tabular}
\end{table} 
Table 2: Examples of data before training models. Training results: We construct decision trees with different depths. Each tree will have rules that give different prediction results. A tree of depth n will inherit inner branches from a tree of depth \(n-1\) and has additional conditions for making predictions. An example to illustrate a decision tree with a depth of 4 is shown in Figure 9.  
In addition, based on the decision tree models and the rules generated, we found that several health factors of the patient are closely related to high blood pressure. For example, a patient with the systolic blood pressure of over 147 usually has some symptoms such as headache, dizziness, and fatigue.