## 5 Results and Discussion
### Confusion Matrix (Precision, Recall)  
In addition to the prediction accuracy, which was analyzed above, the precision and recall of the model is also measured in the machine learning fields and the Confusion Matrix is built [27]. Precision is often analyzed to the detriment of accuracy if the data set or categories are imbalanced. In our case, the data used are balanced; however, the verification of accuracy is a confirmation in the performance analysis. Thus, precision is measured according to the formula below, using the concepts of True Positive and False Positive. \[\text{Pr}=\frac{\text{TP}}{\text{TP}+\text{FP}} \tag{10}\]  
Thus, we analyze the precision for the three algorithms, and we calculate the values first for the Republican data set and then for the Democrat data set. Here are the results for the Republican (Table 1):  
Thus, for precision, the values are very close and the hierarchy of algorithms is preserved. Moreover, the algorithms have a better classification accuracy for the Democrats. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Algorithm** & **Multinomial NB** & **Gaussian NB** & **Bernoulli NB** \\ \hline Precision & 80\% & 77\% & 74\% \\ \hline \hline \end{tabular} The results for the Democrat data set (Table 2):  
\end{table} 
Table 1: Precision for the Republican data set. Figure 12: Graphical representation for Brier Score Loss. A complementary measure to the precision is the recall, calculated with the following formula [22]:  
\[\text{Recall}=\frac{\text{TP}}{\text{TP}+\text{FN}} \tag{11}\]  
Here are the recall results for the Republican (Table 3):  
In the above formulas, we consider the following notations: TN--\"True Negative\", TP--\"True Positive\", FN--\"False Negative\", FP--\"False Positive\". TP refers to truly positive results that have been predictively labeled as positive. TN refers to truly negative results that have been predictively labeled as negative. FN refers to truly positive results that have been predictively labeled as negative. FP refers to truly negative outcomes that have been predictively labeled as positive. These notations are used to build the Confusion Matrix [22]. In this metric of the classification evaluation, the prediction values for each class are presented in matrix form, as well as the value which had to be obtained (the reference). Figure 14 shows the Confusion Matrix representation for the NB Multinomial algorithm. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Algorithm** & **Multinomial NB** & **Gaussian NB** & **Bernoulli NB** \\ \hline Precision & 80\% & 77\% & 73\% \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Recall for the Democrat data set. Figure 13: Representation of the values True Republican and Democrat, respectively False Republican and Democrat in the case of the Multinomial NB model. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Algorithm** & **Multinomial NB** & **Gaussian NB** & **Bernoulli NB** \\ \hline Precision & 83\% & 80\% & 76\% \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Recall for the Republican data set. In Figure 14, the values for the correct classifications in the Republican and Democrat classes, as well as for the erroneous ones, are the same from the previous chart in Figure 13. Using the heatmap utility in the Python Seaborn library, we can observe the color code associated with the values. On the main diagonal of the matrix are the values from the Republican class, identified as Republican type, respectively, the values from the Democrat class identified as Democrat type. In quadrant 1,2 are the values of Republican type marked as Democratic, and in quadrant 2,1 are the values of Democrat type marked as Republican. As can be seen in the Figure 15, on the main diagonal we have the tweets correctly labeled divided into categories: Republican and Democrat.