diff --git a/book/3-classification.tex b/book/3-classification.tex index 7ebe745..d832339 100644 --- a/book/3-classification.tex +++ b/book/3-classification.tex @@ -344,7 +344,22 @@ \subsection{Balanced Accuracy} % formula \begin{center} - [FORMULA GOES HERE] + \tikz{ + \node[inner sep=2pt, font=\Large] (a) { + { + $\displaystyle + Balanced-Accuracy = \frac{1}{2} \left( + \frac{\textcolor{nmlred}{TP}}{\textcolor{nmlred}{TP} + \textcolor{nmlgreen}{FN}} + + \frac{\textcolor{nmlcyan}{TN}}{\textcolor{nmlcyan}{TN} + \textcolor{nmlpurple}{FP}} + \right) + $ + } + }; + \draw[-latex, nmlgreen, semithick] ($(a.south)+(2.1,0.04)$) to[bend left=25] node[pos=1, left] {\color{nmlgreen} false negative} +(-.8, -.5); + \draw[-latex, nmlpurple, semithick] ($(a.south)+(5.1,0.04)$) to[bend left=-25] node[pos=1, right] {\color{nmlpurple} false positive} +(.8, -.7); + \draw[-latex, nmlred, semithick] ($(a.south)+(1.5, 1.3)$) to[bend right=25] node[pos=1, left] {\color{nmlred} true positive} +(-0.9, .6); + \draw[-latex, nmlcyan, semithick] ($(a.south)+(4.5, 1.3)$) to[bend left=25] node[pos=1, right] {\color{nmlcyan} true negative} +(0.9, .6); + } \end{center} It is particularly useful when working with datasets where some classes are significantly underrepresented, ensuring that the performance of all classes is treated equally.