Accuracy, Precision, Recall, F1 Score, Sensitivity, Specificity


Table of Contents

Headnotes

Many equations and formulas look intimidating. However, when you hunt them down, they are definitely not! Just papertigers!

Now let's hunt the papertiger.

Considering a system in diagnosis of disease, we can depict these terms with the rate involved.

(1)   \begin{equation*} % Table generated by Excel2LaTeX from sheet 'Sheet1' \begin{tabular}{cll} & \multicolumn{2}{c}{Actual} \\ {Prediction} & \textcolor[rgb]{ 1, 0, 0}{\textbf{TP}} & \textbf{FP} \\ & \textbf{FN} & \textbf{TN} \\ \end{tabular}% \end{equation*}

Accuracy The rate of all the correctly predicted people in all the people.

(2)   \begin{equation*} \text{Accuracy} = \frac{\text{TP} + \text{TN}}{\text{TP} + \text{TN} + \text{FP} + \text{FN}} \end{equation*}

Precision The rate of people who really get the disease in predicted people with disease.

(3)   \begin{equation*} \text{Precision} = \frac{\text{TP}}{\text{TP}+\text{FP}} \end{equation*}

Recall or Sensitivity For all the actual positives, it’s the rate of how many people with disease are finally predicted.

(4)   \begin{equation*} \text{Recall} = \text{Sensitivity} = \text{True positive rate} = \frac{\text{TP}}{\text{TP}+\text{FN}} \end{equation*}

Specificity For all the healthy people, it’s the rate how many healthy people are identified.

(5)   \begin{equation*} \text{Specificity} = \text{True negative rate} = \frac{\text{TN}}{\text{TN}+\text{FP}} \end{equation*}

F1 Score

(6)   \begin{equation*} \begin{aligned} \text{F1 Score} = & \frac{1}{ \frac{1}{2} (\frac{1}{Recall} + \frac{1}{Precision}) } \\ = & \frac{\text{TP}}{ \text{TP} + \frac{1}{2}(\text{FP}+\text{FN}) } \end{aligned} \end{equation*}


Footnotes

There are many excellent tutorials out there. Some tutorials are too intuitive and it's helpful, but you cannot get it straight on the math details. Some focused on dymestifying math. Some focused on code. I found the best tutorials that give you the conceptual ideas and are possible for implementation without being blind to the math details. Drop a comment if I failed. It would be really appreciable.


If you want to cite this article, please cite this article as:

Lachlan Chen, "Accuracy, Precision, Recall, F1 Score, Sensitivity, Specificity," in EarnFromScratch, September 11, 2020, https://www.earnfs.com/en/html/2622.htm.

or

@misc{lachlanchen2020tutorial,
title=Accuracy, Precision, Recall, F1 Score, Sensitivity, Specificity,
author={Chen, Lachlan},
year=September 11, 2020
}


EarnFromScratch (September 29, 2020) Accuracy, Precision, Recall, F1 Score, Sensitivity, Specificity. Retrieved from https://www.earnfs.com/en/html/2622.htm.
"Accuracy, Precision, Recall, F1 Score, Sensitivity, Specificity." EarnFromScratch - September 29, 2020, https://www.earnfs.com/en/html/2622.htm
EarnFromScratch September 11, 2020 Accuracy, Precision, Recall, F1 Score, Sensitivity, Specificity., viewed September 29, 2020,<https://www.earnfs.com/en/html/2622.htm>
EarnFromScratch - Accuracy, Precision, Recall, F1 Score, Sensitivity, Specificity. [Internet]. [Accessed September 29, 2020]. Available from: https://www.earnfs.com/en/html/2622.htm
"Accuracy, Precision, Recall, F1 Score, Sensitivity, Specificity." EarnFromScratch - Accessed September 29, 2020. https://www.earnfs.com/en/html/2622.htm
"Accuracy, Precision, Recall, F1 Score, Sensitivity, Specificity." EarnFromScratch [Online]. Available: https://www.earnfs.com/en/html/2622.htm. [Accessed: September 29, 2020]


Leave a Reply