# A Machine Learning Predictive Model to Detect Water Quality and Pollution
## 5 Results
### Deep Learning Model Tuning Results  
#### 5.2.1 Tuning the Number of Hidden Layers  
Figure 3 illustrates the prediction accuracy of the train and test dataset under different numbers of hidden layers ranging from 2 to 6, increased by 1. The test accuracy with two hidden layers equals 0.65, increases to 0.75 when hidden layers are 4 and 5, then drops to 0.70 with six hidden layers. The training accuracy for 4 and 5 hidden layers is 0.87 and 0.85, separately. Hence, the five hidden layers prevail over four hidden layers due to less overfitting.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Missing Rate (\%)** & **0.35** & **0.4** & **0.45** & **0.5** & **0.55** & **0.6** & **0.65** \\ \hline \multicolumn{7}{c}{**Iterative Imputation with Extra Tree Estimator**} \\ \hline \(n=5\) & 60.25 \(\pm\) 4.00 & 61.84 \(\pm\) 2.37 & 58.40 \(\pm\) 33.35 & 65.05 \(\pm\) 5.44 & 63.36 \(\pm\) 3.36 & 66.88 \(\pm\) 3.27 & 70.91 \(\pm\) 7.69 \\ \(n=20\) & 62.46 \(\pm\) 2.72 & 64.33 \(\pm\) 5.98 & 64.98 \(\pm\) 5.55 & 66.38 \(\pm\) 4.25 & 67.52 \(\pm\) 4.89 & 70.20 \(\pm\) 3.13 & 77.58 \(\pm\) 5.22 \\ \(n=50\) & 62.13 \(\pm\) 5.94 & 65.99 \(\pm\) 6.18 & 65.94 \(\pm\) 4.49 & 68.34 \(\pm\) 4.50 & 71.76 \(\pm\) 3.32 & 71.00 \(\pm\) 5.41 & 76.57 \(\pm\) 6.59 \\ \hline \end{tabular}
\end{table}
Table 4: The mean and standard deviation of SMAPE in ExtraTree with different tree numbers.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multicolumn{2}{c}{**Imputation Method**} & \multicolumn{6}{c}{**Data Missing Rate**} \\ \cline{3-8}  & **0.35** & **0.4** & **0.45** & **0.5** & **0.55** & **0.6** & **0.65** \\ \hline \multirow{5}{*}{Iterative Imp.} & \(k=5\) & 90.77 \(\pm\) 7.31 & 98.49 \(\pm\) 10.10 & 97.63 \(\pm\) 4.98 & 96.74 \(\pm\) 6.74 & 98.85 \(\pm\) 4.60 & 102.70 \(\pm\) 5.32 & 104.09 \(\pm\) 4.83 \\  & \(k=7\) & 93.49 \(\pm\) 5.92 & 96.89 \(\pm\) 5.93 & 101.57 \(\pm\) 4.79 & 103.57 \(\pm\) 9.84 & 112.02 \(\pm\) 6.40 & 109.42 \(\pm\) 7.54 & 107.64 \(\pm\) 7.20 \\  & \(k=9\) & 100.12 \(\pm\) 8.11 & 100.09 \(\pm\) 8.82 & 109.13 \(\pm\) 9.04 & 111.02 \(\pm\) 4.35 & 109.28 \(\pm\) 3.34 & 108.88 \(\pm\) 8.14 & 105.98 \(\pm\) 8.01 \\ \cline{2-8}  & Bayesian Ridge & 114.92 \(\pm\) 7.78 & 116.46 \(\pm\) 6.56 & 122.05 \(\pm\) 5.15 & 119.76 \(\pm\) 6.09 & 123.83 \(\pm\) 5.28 & 123.91 \(\pm\) 6.43 & 123.25 \(\pm\) 7.18 \\  & Decision Tree & 60.11 \(\pm\) 5.19 & 62.22 \(\pm\) 3.31 & 64.27 \(\pm\) 3.68 & 66.78 \(\pm\) 6.40 & 68.75 \(\pm\) 5.10 & 70.34 \(\pm\) 9.64 & 80.04 \(\pm\) 9.06 \\ \hline \multirow{5}{*}{Iterative Imp.} & \(n=5\) & 60.25 \(\pm\) 4.00 & 61.84 \(\pm\) 2.37 & 58.40 \(\pm\) 33.35 & 65.05 \(\pm\) 5.44 & 63.36 \(\pm\) 3.36 & 66.88 \(\pm\) 3.27 & 70.91 \(\pm\) 7.69 \\  & \(n=20\) & 62.46 \(\pm\) 2.72 & 64.33 \(\pm\) 5.98 & 64.98 \(\pm\) 5.55 & 66.38 \(\pm\) 4.25 & 67.52 \(\pm\) 4.89 & 70.20 \(\pm\) 3.13 & 77.58 \(\pm\) 5.22 \\ \cline{1-1}  & \(n=50\) & 62.13 \(\pm\) 5.94 & 65.99 \(\pm\) 6.18 & 65.94 \(\pm\) 4.49 & 68.34 \(\pm\) 4.50 & 71.76 \(\pm\) 3.32 & 71.00 \(\pm\) 5.41 & 76.57 \(\pm\) 6.59 \\ \hline \end{tabular}
\end{table}
Table 3: The SMAPE score (mean and standard deviation) by using kNN imputation and iterative imputation.  
Figure 2: Comparison of the SMAPE value of different imputation methods with simple imputation as the benchmark.