机器学习中分类结果混淆矩阵
In this blog, I will try to explain all the basic terminologies of the confusion matrix and how to calculate them, with an example.
在这个博客中,我将尝试通过一个例子来解释混淆矩阵的所有基本术语以及如何计算它们。
We use the confusion matrix to evaluate the performance of a classification model. In this example, we are using a classifier to predict whether it is a dog or a cat. My main aim is to make you understand the intuition behind the terminologies.
我们使用混淆矩阵来评估分类模型的性能。 在此示例中,我们使用分类器预测它是狗还是猫。 我的主要目的是使您理解术语背后的直觉。
TRUE POSITIVE (TP): Prediction is a dog and actually a dog.
积极(TP):预测是一只狗,实际上是一只狗。
TRUE NEGATIVE (TN): Prediction is a cat and actually a cat.
真负(TN):预测是猫,实际上是猫。
FALSE POSITIVE (FP): Prediction is a dog and actually a cat. Also known as “TYPE I ERROR”.
假阳性(FP):预测是狗,实际上是猫。 也称为“ TYPE I ERROR ”。
FALSE NEGATIVE (FN): Prediction is a cat and actually a dog. Also known as “TYPE II ERROR”.
假阴性(FN):预测是猫,实际上是狗。 也称为“ TYPE II ERROR ”。
TRUE POSITIVE RATE (TPR) / RECALL / SENSITIVITY / HIT RATE
真实正利率(TPR)/召回率/灵敏度/命中率
When it is actually a dog, how many times our classifier predicts it as a dog. Rate of correctly predicting dogs.
当它实际上是一只狗时,我们的分类器将其预测为狗的次数。 正确预测狗的比率。
TRUE NEGATIVE RATE (TNR) / SPECIFICITY / SELECTIVITY
真负速率(TNR)/比值/选择性
When it is actually a cat, how many times our classifier predicts it as a cat. Rate of correctly predicting cats.
当它实际上是猫时,我们的分类器将其预测为猫的次数。 正确预测猫的比率。
FALSE POSITIVE RATE (FPR) / FALL-OUT
假正利率(FPR)/跌落
When it is actually a cat, how many times our classifier predicts it as a dog.
当它实际上是猫时,我们的分类器将其预测为狗的次数。
FALSE NEGATIVE RATE (FNR) / MISS RATE
假负利率(FNR)/误汇率
When it is actually a dog, how many times our classifier predicts it as a cat.
当它实际上是一只狗时,我们的分类器将其预测为猫的次数。
POSITIVE PREDICTIVE VALUE (PPV) / PRECISION
阳性预测值(PPV)/精度
When our classifier predict dog, how many times it is correct?
当我们的分类器预测狗时,正确的次数是多少?
NEGATIVE PREDICTIVE VALUE (NPV)
负预测值(NPV)
When our classifier predict cat, how many times it is correct?
当我们的分类器预测猫时,它是多少次正确?
ACCURACY
准确性
How often our classifier predicts correctly?
分类器正确预测的频率是多少?
MISCLASSIFICATION RATE / ERROR RATE
错误分类率/错误率
How often our classifier predicts incorrectly?
分类器预测错误的频率有多高?
F1-SCORE
F1-分数
We cannot compare precision and recall together so to make it comparable we take the weighted average of precision and recall.
我们无法将精度和召回率同时进行比较,因此为了使其具有可比性,我们采用了精度和召回率的加权平均值。
F1-Score is the harmonic mean of precision and recall and is crucial when the false negative and false positive are important in our classifier, it also shows a better measure in case of imbalance classes.
F1-Score是精度和召回率的谐波平均值,在假阴性和假阳性在我们的分类器中很重要时至关重要,它在不平衡类的情况下也显示出更好的度量。
PREVALENCE
患病率
How often does the dog actually occur in our sample?
在我们的样本中,狗实际上多久出现一次?
I hope you got some basic idea of what exactly is confusion matrix. If this post helped you please consider giving an👏🏼to motivate me.
我希望您对什么是混淆矩阵有一些基本的了解。 如果这篇文章对您有帮助,请考虑给我一个激励。
翻译自: https://medium.com/swlh/confusion-matrix-in-machine-learning-920eda3d2cb6
机器学习中分类结果混淆矩阵