## 3 Methodology
### Hybrid Prediction Model for Fault Detection

Table 4: The significance of features presented by Information Gain (IG) Score. Figure 4: Hybrid Prediction Model using Density-Based Spatial Clustering of Applications with Noise (DBSCAN)-based outlier detection and Random Forest (RF)-based classifier. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Feature** & **Description** & \multicolumn{2}{c}{**Normal Class**} & \multicolumn{2}{c}{**Abnormal Class**} \\ \cline{3-5}  & & **Mean** & **STD** & **Mean** & **STD** \\ \hline temp & Temperature & 22.0958333 & 0.294977719 & 24.04901961 & 1.26159926 \\ hum & Humidity & 19.90416667 & 0.294977719 & 19.99019608 & 11.70638744 \\ ax & The x value of accelerometer & 1.557855833 & 3.568198363 & \(-\)1.991126471 & 4.533231608 \\ ay & The y value of accelerometer & 2.1834275 & 1.362406134 & 4.090368627 & 8.006935948 \\ az & The z value of accelerometer & 15.72753 & 171.4913135 & 48.21502549 & 153.998157 \\ gx & The x value of the gyroscope & \(-\)0.013850417 & 0.0007848499 & \(-\)0.012051961 & 0.052695636 \\ gy & The y value of the gyroscope & \(-\)0.105782917 & 0.000897929 & \(-\)0.01652549 & 0.02378498 \\ gz & The z value of the gyroscope & 0.999329167 & 0.003934067 & 0.996021569 & 0.053289554 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Distribution of dataset. DBSCAN-based outlier detection was utilized in our study to filter out outlier data from the dataset [52]. Dense regions were created by finding the objects close to a given point. Outliers were defined as the points located outside dense regions. Epsilon (_eps_) and minimum points (_MinPts_) are two important parameters considered in DBSCAN. _eps_ defines the radius distance of the neighborhood around a point \(x\) (_\(\epsilon\)-neighborhood_ of \(x\)) and _MinPts_ defines the minimum number of neighbor points within the defined radius distance of _eps_. For dataset \(D\), which is marked as unvisited, DBSCAN works as follows:  
* For each unvisited point \(x_{i}\) in \(D\), find the _\(\epsilon\)-neighborhood_ of \(x_{i}\) that includes at least _MinPts_ points. Then \(x_{i}\) is labeled as visited. * For point \(x_{i}\), which is not assigned to a specific cluster, create a new cluster \(C\). Add the points in the _\(\epsilon\)-neighborhood_ of \(x_{i}\) to a candidate set \(N\). Add any points in \(N\) (that do not belong to any cluster) to \(C\). * For each point \(p\) in \(N\), find the _\(\epsilon\)-neighborhood_ of \(p\) that includes at least _MinPts_ points. Those points in the _\(\epsilon\)-neighborhood_ of \(p\) are then included in the candidate set \(N\) and assigned to cluster \(C\). Finally, \(p\) is labeled as visited. * Iterate the process for the remaining points in \(N\) and the unvisited points in the dataset \(D\). * The points that do not belong to any cluster are labeled as outliers. Due to the imperfect sensing device and network connection problems, some of the data collected by the sensor may be noise caused by outlier data. Outlier detection based on DBSCAN was applied to our dataset. The optimal value of _MinPts_ and _eps_ should be defined first in order to perform DBSCAN-based outlier detection. If the value of _eps_ is too small, more clusters will be created, and normal data could be classified as outliers. However, if it is too big, less clusters will be generated, and true outliers could be classified as normal data. Through the different setup of the experiments, the optimal parameters for _MinPts_ and _eps_ were discovered, they are 5 and 7. Figure 5 shows the results of DBSCAN implementation for the dataset in two-dimensional graphs. DBSCAN performed clustering by grouping the data into three clusters, presented as clusters 1, 2, and 3. The outliers were unclustered data and were presented as cluster 0. The description of dataset, optimal parameters, and outlier data are presented in Table 5. Finally, the outlier data were removed from the dataset, and the remaining data were used for further analysis. Random Forest is a popular classification method for solving real-world classification problems [66; 74; 75; 76].