# Contrails and Their Dependence on Meteorological Situations
## 3 Results
### Advanced Statistical Methods for the Evaluation of Data
#### 3.2.2 Machine Learning Methods for Classification of Contrail Lifetime  
Several machine learning methods were compared, processed, and modeled in Scilab 6.1.1 (www.scilab.org (accessed on 3 September 2023)) and Knime (www.knime.com (accessed on 12 September)) to obtain the most accurate classification. The discretized contrail lifetime y (y\({}_{1}\) up to 1 min, y\({}_{2}\) above 1 min) was classified based on 12 selected parameters x(i) from datasets 1 and 2. Four methods for continuous input variables were chosen to develop and validate a suitable classification model: Naive Bayes, Logistic regression, Random Forests, and K-nearest neighbor classification (K-NN). The last method used for classification was the Discrete categorical model (DCM), where the input x was discretized. The summary results of the classifications are shown in Table 2.  
Random Forests performed best in all performance characteristics and predicted the fewest errors of the used classification models examined for prediction of contrail lifetime divided by 1 min. K-NN and Discrete categorical model had average results in accuracy (number of correct predictions). The highest precision values (proportion of positive predictions) were calculated for the K-NN and Discrete categorical models. Very high sensitivity values (how many true points were classified correctly) were also achieved for Naive Bayes. The second-best F1 score, which indicates the quality of the classifier, was measured for the Discrete categorical model. Naive Bayes and Logistic regression as stable classifiers performed the worst on the unbalanced dataset, with the weakest success rate. Another contrail lifetime model was performed for y (y\({}_{1}\) up to 5 min, y\({}_{2}\) above 5 min) for discrete input variables. The three most important variables, x, in terms of their dependence on contrail lifetime were selected according to the results from the correlation (see Table 1), namely temperature, dew point temperature, and ice point temperature, due to the large computational complexity of multiple input variables. The other parameters did not increase the classification accuracy and expanded the parameter set with additional datasets at the same time. These x variables were discretized into four intervals according to mean (m) and standard deviation (s) as follows: (min, m-s), (m-s, m), (m, m + s), and (m + s, max). The training and testing set was used in all models. The best result was obtained for the \begin{table}
\begin{tabular}{c c} \hline
**Variables x(i)** & **Corr. Coefficients c** \\ \hline Aircraft type & 0.0263 \\ Initial aircraft level & \(-\)0.00287 \\ GS & 0.0241 \\ TAS & \(-\)0.0319 \\ Pressure & 0.0491 \\ Geopotential probe height & \(-\)0.0429 \\ Temperature & \(-\)0.1245 \\ Dew point temperature & 0.1708 \\ Ice point temperature & 0.1717 \\ Wind direction & 0.1139 \\ Wind speed & \(-\)0.0926 \\ Tropopause height & \(-\)0.0914 \\ \hline \end{tabular}
\end{table} 
Table 1: Correlation coefficients (c) for correlation contrail lifetime (y) on variables x(i). \begin{table}
\begin{tabular}{c c c c c c} \hline
**Model** & **Division** & **Accuracy** & **Precision** & **Sensitivity** & **F1 Score** \\ \hline Naive Bayes & 1 min & 0.7594 & 0.7652 & 0.9766 & 0.8581 \\ Logistic regression & 1 min & 0.7340 & 0.7515 & 0.9533 & 0.8405 \\ Random Forests & 1 min & 0.9727 & 0.9757 & 0.9938 & 0.9847 \\ K-NN & 1 min & 0.7768 & 0.8096 & 0.9105 & 0.8571 \\ DCM & 1 min & 0.7712 & 0.8426 & 0.9010 & 0.8708 \\ \hline \end{tabular}
\end{table} 
Table 2: Performance characteristics of the classification models for contrail lifetime to the division of duration according to 1 min. Discrete categorical model, Table 3 shows the outputs of measured y and predicted \(\gamma_{\text{p}}\). The performance characteristics of this model are listed in Table 4.  
The model correctly identifies 310 short-lived contrails and 2 long-lived contrails. It has very few, 33, wrong estimates.