Skip to content

Adding Balanced Accuracy formula #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion book/3-classification.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down