10.4 Métricas de desempenho

As métricas de desempenho são importantes para avaliar a capacidade preditiva dos modelos. As principais podem ser obtidas pelo pacote caret (Kuhn 2022). A tabela https://en.wikipedia.org/wiki/Precision_and_recall#Definition pode ser útil.

Seja \(\{ \text{Verdadeiro}, \text{Falso} \} \times \{ \text{Positivo}, \text{Negativo} \} \equiv \{ V, F \} \times \{ P, N \} = \{ VP, VN, FP, FN \}\) o conjunto de todos os status de classificação possíveis.

Reference
Predicted Event No event
Event TP FP
No event FN TN

\[\begin{equation} \text{Acurácia}=\frac{VP+VN}{VP+VN+FP+FN} \tag{10.1} \end{equation}\]

\[\begin{equation} \text{Balanced Accuracy}=\frac{\text{Sensitivity} + \text{Specificity}}{2} \tag{10.2} \end{equation}\]

\[\begin{equation} \text{Detection Prevalence}=\frac{TP+FP}{TP+TN+FP+FN} \tag{10.3} \end{equation}\]

\[\begin{equation} \text{Detection Rate}=\frac{TP}{TP+TN+FP+FN} \tag{10.4} \end{equation}\]

\[\begin{equation} \text{F1}=\frac{2TP}{2TP+FP+FN} \tag{10.5} \end{equation}\]

\[\begin{equation} \text{Kappa}=\frac{TP \times TN - FP \times FN}{\sqrt{(TP+FP)(TN+FN)(TP+FN)(TN+FP)}} \tag{10.6} \end{equation}\]

\[\begin{equation} \text{Neg Pred Value}=\frac{TN}{TN+FN} \tag{10.7} \end{equation}\]

\[\begin{equation} \text{Pos Pred Value}=\frac{\text{Sensitivity} \times \text{Prevalence}}{(\text{Sensitivity} \times \text{Prevalence}) + ((1-\text{Specificity}) \times (1-\text{Prevalence}))} \tag{10.8} \end{equation}\]

\[\begin{equation} \text{Precision}=\frac{TP}{TP+FP} \tag{10.9} \end{equation}\]

\[\begin{equation} \text{Prevalence}=\frac{TP+FN}{TP+FP+FN+TN} \tag{10.10} \end{equation}\]

\[\begin{equation} \text{Recall}=\frac{TP}{TP+FN} \tag{10.11} \end{equation}\]

\[\begin{equation} \text{Sensitivity}=\frac{TP}{TP+FN} \tag{10.12} \end{equation}\]

\[\begin{equation} \text{Specificity}=\frac{TN}{TN+FP} \tag{10.13} \end{equation}\]

Referências

Kuhn, Max. 2022. Caret: Classification and Regression Training. https://CRAN.R-project.org/package=caret.