修正了部分文档中的笔误

This commit is contained in:
jackfrued 2025-02-13 16:10:46 +08:00
parent 841c5a2dc7
commit dcd7a8a41b
1 changed files with 42 additions and 37 deletions

View File

@ -241,43 +241,48 @@ model.score(X_test, y_test)
| **实际为未患病** | 30FP | 870TN |
1. **准确率**Accuracy
$$
\text{Accuracy} = \frac{\text{TP} + \text{TN}}{\text{TP} + \text{FP} + \text{FN} + \text{TN}}
$$
上面的例子,模型预测的准确率为: $\small{\frac{80 + 870}{80 + 30 + 20 + 870} = \frac{950}{1000} = 0.95}$ 。
$$
\text{Accuracy} = \frac{\text{TP} + \text{TN}}{\text{TP} + \text{FP} + \text{FN} + \text{TN}}
$$
上面的例子,模型预测的准确率为: $\small{\frac{80 + 870}{80 + 30 + 20 + 870} = \frac{950}{1000} = 0.95}$ 。
2. **精确率**Precesion。精确率用于衡量在所有被预测为正类的样本中实际上属于正类的比例通常也被称为查准率。
$$
\text{Precesion} = \frac{\text{TP}}{\text{TP} + \text{FP}}
$$
上面的例子,模型预测的精确率为: $\small{\frac{80}{80 + 30} = \frac{80}{110} = 0.73}$ 。
$$
\text{Precesion} = \frac{\text{TP}}{\text{TP} + \text{FP}}
$$
上面的例子,模型预测的精确率为: $\small{\frac{80}{80 + 30} = \frac{80}{110} = 0.73}$ 。
3. **召回率**Recall。召回率用于衡量在所有实际为正类的样本中被模型正确预测为正类的比例通常也被称为查全率或真正例率True Positive Rate
$$
\text{Recall} = \frac{\text{TP}}{\text{TP} + \text{FN}}
$$
上面的例子,模型预测的召回率为: $\small{\frac{80}{80 + 20} = \frac{80}{100} = 0.8}$ 。
$$
\text{Recall} = \frac{\text{TP}}{\text{TP} + \text{FN}}
$$
上面的例子,模型预测的召回率为: $\small{\frac{80}{80 + 20} = \frac{80}{100} = 0.8}$ 。
4. **F1 分数**F1 Score。F1 分数是精确率和召回率的调和平均数,它在精确率和召回率之间寻求一个平衡,尤其适用于在两者之间有权衡的情况。
$$
\text{F1 Score} = \frac{2}{\frac{1}{\text{Precision}} + \frac{1}{\text{Recall}}} = 2 \times \frac{\text{Precision} \times \text{Recall}}{\text{Precesion} + \text{Recall}}
$$
上面的例子模型预测的F1 分数为: $\small{2 \times \frac{0.7273 * 0.8}{0.7273 + 0.8} = 0.76}$ 。
$$
\text{F1 Score} = \frac{2}{\frac{1}{\text{Precision}} + \frac{1}{\text{Recall}}} = 2 \times \frac{\text{Precision} \times \text{Recall}}{\text{Precesion} + \text{Recall}}
$$
5. **特异度**Specificity和**假正例率**False Positive Rate。特异度用于衡量的是在所有实际为负类的样本中被模型正确预测为负类的比例类似于召回率只不过针对的是负类样本。
$$
\text{Specificity} = \frac{\text{TN}}{\text{TN} + \text{FP}}
$$
上面的例子模型预测的F1 分数为: $\small{2 \times \frac{0.7273 * 0.8}{0.7273 + 0.8} = 0.76}$ 。
$$
\text{False Positive Rate} = 1 - \text{Specificity}
$$
5. **特异度**Specificity和**假正例率**False Positive Rate简称 FPR。特异度用于衡量的是在所有实际为负类的样本中被模型正确预测为负类的比例类似于召回率只不过针对的是负类样本。
上面的例子,模型预测的特异度为: $\small{\frac{870}{870 + 30} = \frac{870}{900} = 0.97}$ 。
$$
\text{Specificity} = \frac{\text{TN}}{\text{TN} + \text{FP}}
$$
$$
\text{FPR} = 1 - \text{Specificity}
$$
上面的例子,模型预测的特异度为: $\small{\frac{870}{870 + 30} = \frac{870}{900} = 0.97}$ 。
6. **ROC****AUC**