# Comparative Analysis of Classifiers for Classification of Emergency Braking of Road Motor Vehicles
## Methods
### Quality Metrics  
In order to evaluate the performance and quality of the trained classifier, applied to the particular EBC problem, we consider using metrics which are not commonly considered. The straightforward approach would have been to use the percentage of correct answers--accuracy. However, this metric if not feasible for the considered EBC problem because if the classifier detects all normal driving cases and 1/4 of emergency braking cases, then the accuracy will be equal to 0.7. However, we will miss almost all emergency braking events, suggesting that the metric is not adequate for the evaluation of quality of the classifiers. Therefore, in our approach we apply more informative metrics like precision, recall, and F-score [17] to evaluate the performance of the classifier. For illustration of these metrics, we shall consider the confusion matrix as shown in Table 1. The table illustrates four categories and provides information about how many times the classifier has given the correct answer and how many times the wrong decision has been adopted.  
The true positive category (_TP_) is equal to the number of samples which are classified as class \"1\" (emergency braking) and are actually in the class \"1\". False positive (_FP_) corresponds to the samples for which the correct class is \"0\" (normal driving) but the classifier returns \"1\"; vice versa, if the classifier recognizes the sample as \"0\" but the real answer is \"1\", then the sample is considered as a false negative (_FN_). Finally, true negative (_TN_) corresponds to the cases when the sample belongs to the class \"0\" and the classifier indeed returns \"0\". In this way, recall and precision can be expressed as follows:  
\[Precision=\frac{TP}{TP+FP}\,\]  
\[Recall=\frac{TP}{TP+FN}\.\]  
Both of these metrics describe different aspects of the classifier: the higher the precision, the lower the _FP_; and the higher the recall, the lower the _FN_. Obviously, _FP_ (resulting in emergency braking during normal driving conditions) cases are not preferable due to the resulting uncomfortable driving (and, in some cases, unsafe). However, _FP_ should not necessarily be considered dangerous; we shall  
\begin{table}
\begin{tabular}{c c c c} \hline \hline  & & \multicolumn{2}{c}{**True Condition**} \\ \cline{3-4}  & & **Positive** & **Negative** \\ \hline Predicted & Positive & _TP_ & _FP_ \\ condition & Negative & _FN_ & _TN_ \\ \hline \hline \end{tabular}
\end{table}
Table 1: Confusion matrix.  
elaborate as to why later, in the discussions section of this article. Therefore, for the sake of the comfort of the driver (and passengers) we are interested in maximizing the precision metric. On the other hand, it is necessary to detect as many cases of emergency braking as possible and, as a consequence, to outperform the straightforward threshold classifier which apparently features relatively low values of recall. Thereby, we should pay attention to both of these metrics, and the F-score allows us to do this objective:  
\[F=2*\frac{Precision\times Recall}{Precision+Recall}\.\]  
The F-score can be seen as the harmonic mean of both precision and recall. The scaling coefficient 2 is used in order to normalize the value of the F-score to 1 when both recall and precision are equal to \(1\).