**5. Conclusion**

A KNN supervised machine learning algorithm is used in this paper to classify precipitation types with ground-based radar data. The ground-based radar data are from Anhui, Jiangsu, Guangdong and Zhejiang Provinces, and the classification results were evaluated using the 2A23 cloud classification product from the TRMM PR at the same time. The KNN algorithm is characterized by high precision, insensitivity to abnormal data, no data input assumptions, and a fast computational speed in the case of small data samples. The method performs well in the classification of precipitation types based on radar data. The radar reflectivity at a height of 2 km and VIL were selected as the classification variables. The values of these two variables in the cases of stratiform precipitation and convective precipitation were compared, and it was found that the two variables di ffer greatly for the di fferent precipitation types. These two variables and corresponding precipitation types in the 2A23 product were input as training samples in the KNN algorithm. The algorithm calculates the distance between the input samples and the stored training samples (the standardized Euclidean distance was calculated in this paper). The maximum number of classification labels in the k samples closest to the input samples was taken as the classification result for the input samples. Samples can be classified into stratiform precipitation, convective precipitation and other types of precipitation.

Three di fferent precipitation systems (stratiform precipitation, embedded convection, and squall lines) were analyzed. The KNN method is accurate in classifying the location and range of stratiform precipitation and can e ffectively describe the band arrangemen<sup>t</sup> pattern of multiple convective units in squall lines. Moreover, the position and shape of squall lines is well described, and the distribution of convective precipitation and stratiform precipitation is accurately described in the embedded convective systems.

The classification results and accuracy of all cases were analyzed, and the performance of the KNN algorithm in precipitation classification was evaluated. The statistical results confirm the results of the case analysis. Among the overall classification results of many processes and cases, the KNN algorithm is the most accurate in the classification of stratiform precipitation, with a POD of 0.950 and an FAR of only 0.085. The CSI, which reflects the overall classification, reaches 0.874. In all cases, the POD of convective classification is 0.781, the FAR is 0.137, and the CSI is 0.695. The evaluation results indicate that the KNN algorithm can accurately classify almost all stratiform precipitation, and most of the convective precipitation can also be classified accurately.

Because the duration of the radar data is insu fficient, it is impossible to study the classification of precipitation types with the KNN algorithm in a certain area over a long period. Although the training and classification cases are limited, the results of the classification in di fferent years and for di fferent regional precipitation types could be important. If long-term radar data from a region were selected, more reliable and accurate classification results could be obtained, and the local climate characteristics and precipitation distribution could be better studied.

**Author Contributions:** Conceptualization, Z.Y. and Y.Y.; methodology, Z.Y., P.L. and Y.Y.; software, Z.Y. and P.L.; investigation, Z.Y. and P.L.; writing—original draft preparation, Z.Y.; writing—review and editing, Z.Y., P.L. and Y.Y.; visualization, Z.Y. and P.L.; supervision, Y.Y.

**Funding:** This research was supported by the National Key Research and Development Program of China (2017YFC1502102) and the National Nature Science Foundation of China (41675098).

**Acknowledgments:** We thank the National Aeronautics and Space Administration (NASA) and Japan Aerospace Exploration (JAXA) for providing the 2A23 TRMM precipitation radar rain characteristics product (https://disc.gsfc. nasa.gov/datasets/TRMM\_2A23\_V7/summary?keywords=2A23) as the training and evaluating data. We thank the Weather Service Forecast Office of Anhui Province and Jiangsu Province for providing radar data.

**Conflicts of Interest:** The authors declare no conflict of interest.
