Skip to content

Commit b56d5dc

Browse files
committed
eq ch 6
1 parent 376d6d4 commit b56d5dc

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

docs/equations/pymle-equations.pdf

2.58 KB
Binary file not shown.

docs/equations/pymle-equations.tex

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,12 +1203,60 @@ \section{Looking at different performance evaluation metrics}
12031203
\subsection{Reading a confusion matrix}
12041204
\subsection{Optimizing the precision and recall of a classification model}
12051205

1206+
Both the prediction error (ERR) and accuracy (ACC) provide general information about how many samples are misclassi ed. The error can be understood as the sum of all false predictions divided by the number of total predictions, and the accuracy is calculated as the sum of correct predictions divided by the total number of predictions, respectively:
1207+
12061208
\[
12071209
ERR = \frac{FP + FN}{FP + FN + TP + TN}
12081210
\]
12091211

1212+
(TP = true positives, FP = false positives, TN = true negatives, FN = false negatives)
1213+
1214+
The prediction accuracy can then be calculated directly from the error:
1215+
1216+
\[
1217+
ACC = \frac{TP + TN}{FP + FN + TP + TN} = 1 - ERR
1218+
\]
1219+
The true \textit{positive rate} (TPR) and \textit{false positive rate} (FPR) are performance metrics that are especially useful for imbalanced class problems:
1220+
1221+
\[
1222+
FPR = \frac{FP}{N} = \frac{FP}{FP + TN}
1223+
\]
1224+
1225+
\[
1226+
TPR = \frac{TP}{P} = \frac{TP}{FN+TP}
1227+
\]
1228+
1229+
\textit{Precision (PRE)} and \textit{recall} (REC) are performance metrics that are related to those true positive and true negative rates, and in fact, recall is synonymous to the true positive rate:
1230+
1231+
\[
1232+
PRE = \frac{TP}{TP + FP}
1233+
\]
1234+
1235+
\[
1236+
REC = TPR = \frac{TP}{P} = \frac{TP}{FN + TP}
1237+
\]
1238+
1239+
In practice, often a combination of precision and recall is used, the so-called \textit{F1-score}:
1240+
1241+
\[
1242+
\text{F1} = 2 \times \frac{PRE \times REC}{PRE + REC}
1243+
\]
1244+
12101245
\subsection{Plotting a receiver operating characteristic}
12111246
\subsection{The scoring metrics for multiclass classification}
1247+
1248+
he micro-average is calculated from the individual true positives, true negatives, false positives, and false negatives of the system. For example, the micro-average of the precision score in a k-class system can be calculated as follows:
1249+
1250+
\[
1251+
PRE_{micro} = \frac{TP_1 + \dots + TP_k}{TP_1 + \dots + TP_k + FP_1 + \dots + FP_k}
1252+
\]
1253+
1254+
The macro-average is simply calculated as the average scores of the different systems:
1255+
1256+
\[
1257+
PRE_{macro} = \frac{PRE_1 + \dots + PRE_k}{k}
1258+
\]
1259+
12121260
\section{Summary}
12131261

12141262

0 commit comments

Comments
 (0)