## 4 Hybrid Prediction Model
### Outlier Detection Based on DBSCAN  
In this study, DBSCAN [52] was used to detect the outlier data in a diabetes and hypertension dataset. The goal is to find objects that close to a given point in order to create dense regions. The points that are located outside dense regions are treated as outliers. In DBSCAN, two important parameters must be considered: epsilon (_eps_), which defines the radius of neighborhood around a point x (_\(\epsilon\)-neighborhood_ of x), and minimum points (_MinPts_), which defines the minimum number of neighbors within the _eps_ radius. For the dataset \(D\), DBSCAN works as explained in Algorithm 1. ```
Input: dataset \(D\), minimum point minPts, radius \(\epsilon\) Output: clustered and outlier data for each point \(P\) in dataset \(D\)do ifP is not visitedthen  mark P as visited  neigbrPts \(\leftarrow\) points in \(\epsilon\)-neighborhood of P ifsizeof(neigbrPts) \(<\) minPtsthen  mark P as outlier end else  add P to new cluster C for each point \(P^{\prime}\) in neigbrPtsdo if\(P^{\prime}\) is not visitedthen  mark P\({}^{\prime}\) as visited  neigbrPts\({}^{\prime}\)\(\leftarrow\) points in \(\epsilon\)-neighborhood of P\({}^{\prime}\) ifsizeof(neigbrPts') \(\geq\) minPtsthen  neigbrPts \(\leftarrow\) neigbrPts + neigbrPts'  end if if\(P^{\prime}\) is not a member of any clusterthen  add P\({}^{\prime}\) to cluster C



minimum number of data is 5). Next, the optimal number of _eps_ must be defined. First, we calculate the average of the distances of every point to its k-nearest neighbors. The value of k refers to _MinPts_ and it is defined by the user. Finally, these k-distances are plotted in an ascending order and called the sorted k-dist graph. The objective is to calculate the \"knee\" for estimating the set of _eps_ parameter. A \"knee\" denotes to a threshold where a sharp change appears beside the k-distance curve. The calculation of k-nearest neighbor distance and DBSCAN are applied in R programming language version 3.4.4 [61]. In order to allow for the DBSCAN to cluster the dataset, all the categorical value in each dataset must be converted into numerical values. Figure 2a,c,e show the sorted k-dist graph and optimal value of _eps_ for datasets I, II, III, respectively. For dataset I, the \"knee\" is appearing around the distance of 36, while for dataset II and III, they appear at around 9 and 6, respectively. Furthermore, the DBSCAN technique is applied for each dataset given optimal _MinPts_ and _eps_. Figure 2b,d shows the result of clustering implementation for datasets I and II plotted in two-dimensional graphs. The result showed that for datasets I and II, the DBSCAN performed clustering by grouping the data into single cluster and presented as cluster 1 (see Figure 2b,d). The outliers are un-clustered data and presented as cluster 0 (see Figure 2b,d). Furthermore, for dataset III, the DBSCAN successfully cluster the dataset into five groups (see Figure 2f). The outlier is defined as un-clustered data (i.e., defined as cluster 0 in Figure 2f). The description of dataset, optimal parameters, and final outlier data are presented Table 4. Finally, for each dataset, the outlier data are removed, and normal data are utilized for further analysis. Figure 2: _Cont._

### SMOTE for Imbalanced Dataset

In this study, the proposed HPM utilizes SMOTE to balance the imbalance dataset. Table 5 shows the number of instances increase by SMOTE. For all of the datasets, the distribution between minority and majority cases is imbalanced. In datasets I and III, the minority cases are the subjects who are diagnosed with diabetes (class \"Yes\"), while for dataset II, the minority cases are the subjects who are diagnosed with hypertension (class \"Yes\"). The original percentage of minority cases over the total number of instances for datasets I, II, and III are 13.67%, 23.87%, and 34.54%, respectively.