# Detection of Precipitation and Fog Using Machine Learning on Backscatter Data from Lidar Ceilometer
## 4 Weather Detection
### Feature Selection  
A large number of input features significantly increases the computation time of machine learning algorithms and requires an enormous amount of training data to ensure sufficient training. There are 452 input features as shown in Table 9, and these need to be reduced. Figures 2 and 3 show the analyses of denoised backscatter data from 1 January 2015 to 31 May 2016 for precipitation and visibility sensor data, respectively. In Figure 2, 'True' indicates the case of precipitation, and 'False' indicates the case of non-precipitation. In Figure 3, 'True' indicates that the visibility sensor value is equal to or lower than 1000 m, and 'False' indicates that the visibility sensor value is higher than 1000 m. The line indicates the backscatter mean value according to height, and the colored part indicates the area of mean \(\pm\) standard deviation. Above certain heights, it seems difficult to predict the weather phenomena using backscatter data.  
to 3300 m yielded better results than using all the heights that ranged from 10 m to 4500 m. Therefore, the visibility sensor data could yield better results with smaller inputs.  
In the case of precipitation, the number of input features was not reduced by feature selection, and in the case of visibility sensor, the number of input features was reduced to 332, which is not small enough. To train SVM and ANN, we did not use all the heights of the backscatter data. In the case of precipitation, the height intervals of input features were changed from 10 m to 100 m. In other words, we used the backscatter data at 10 m, 110 m, 210 m,..., and 4410 m. For visibility sensor, we used the backscatter data at 10 m, 110 m,..., and 3210 m. Therefore, 47 input features were used to predict precipitation and 35 features to predict fog.  
With our final model of random forest preprocessed by under-sampling and feature selection, we provide some observation of representative cases for precipitation and fog in Appendix B.  
Tables 15 and 16 show the results of SVM and ANN. ANN1 is an MLP with one hidden layer whose number of nodes is half of that of the input layer. ANN2 is an MLP with two hidden layers, and the number of nodes at each hidden layer is half that of its input layer. For both precipitation and fog, random forest best classified the weather phenomena, yielding the highest F1 score.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Height Feature** & **Accuracy** & **Precision** & **FAR** & **Recall (POD)** & **F1 Score** \\ \hline Up to 300 m & 0.8824 & 0.2398 & 0.7602 & 0.1243 & 0.1637 \\ Up to 600 m & 0.8978 & 0.3178 & 0.6822 & 0.1804 & 0.2301 \\ Up to 900 m & 0.9083 & 0.3651 & 0.6349 & 0.2230 & 0.2769 \\ Up to 1200 m & 0.9106 & 0.3920 & 0.6080 & 0.2385 & 0.2965 \\ Up to 1500 m & 0.9121 & 0.4144 & 0.5856 & 0.2501 & 0.3120 \\ Up to 1800 m & 0.9098 & 0.4344 & 0.5656 & 0.2490 & 0.3165 \\ Up to 2100 m & 0.9108 & 0.4506 & 0.5494 & 0.2564 & 0.3268 \\ Up to 2400 m & 0.9081 & 0.4591 & 0.5409 & 0.2509 & 0.3245 \\ Up to 2700 m & 0.9088 & 0.4613 & 0.5387 & 0.2535 & 0.3272 \\ Up to 3000 m & 0.9050 & 0.4873 & 0.5127 & 0.2498 & 0.3303 \\ Up to 3300 m & 0.9063 & 0.4852 & 0.5148 & 0.2429 & 0.3325 \\ Up to 3600 m & 0.9043 & 0.4960 & 0.5040 & 0.2501 & 0.3325 \\ Up to 3900 m & 0.9032 & 0.5075 & 0.4925 & 0.2503 & 0.3325 \\ Up to 4200 m & 0.9031 & 0.5131 & 0.4869 & 0.2512 & 0.3373 \\ Up to 4500 m & 0.9025 & 0.5172 & 0.4828 & 0.2507 & **0.3377** \\ \hline \hline \end{tabular}
\end{table}
Table 13: Results of precipitation detection according to feature selection. The bold number is the best result.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Height Feature** & **Accuracy** & **Precision** & **FAR** & **Recall (POD)** & **F1 Score** \\ \hline Up to 300 m & 0.9655 & 0.0836 & 0.9164 & 0.0405 & 0.0546 \\ Up to 600 m & 0.9771 & 0.0663 & 0.9337 & 0.0630 & 0.0646 \\ Up to 900 m & 0.9798 & 0.0717 & 0.9283 & 0.0854 & 0.0780 \\ Up to 1200 m & 0.9818 & 0.0812 & 0.91