+1 vote
in General IT Tips by (60.8k points)
I want to generate a confusion matrix showing true positive, false positive, true negative, and false negative for binary classification. How can I construct it using latex?

1 Answer

+2 votes
by (59.1k points)
selected by
Best answer

You can use the following lines in your latex document to generate the confusion matrix for a binary classifier.














\multirow{2}{*}{\textbf{Actual}}& \textbf{Positive} & True Positive (TP) & False Negative (FN)  & $TP+FN$\\


& \textbf{Negative} & False Positive (FP) & True Negative (TN) & $FP+TN$\\


\multicolumn{1}{c}{} & \multicolumn{1}{c}{\textbf{Total}} & \multicolumn{1}{c}{$TP+FP$} & \multicolumn{    1}{c}{$FN+TN$} & \multicolumn{1}{c}{$N$}\\


\caption{Confusion matrix for binary classification}




Related questions

+1 vote
1 answer
+1 vote
1 answer
+2 votes
1 answer