代价矩阵和混淆矩阵
Confusion matrix is an N*N matrix (N = number of target classes) consisting a count of predicted and actual target values. It helps in evaluating the performance of a classification model.
混淆矩阵是一个N * N矩阵(N =目标类别数),由预测和实际目标值组成。 它有助于评估分类模型的性能。
Let’s take a look at a confusion matrix for binary classification to understand the terminology used.
让我们看一下二进制分类的混淆矩阵,以了解所使用的术语。
![Image for post](https://miro.medium.com/max/9999/1*-z9PW3bpZMRsjavgao-teQ@2x.jpeg)
Whether a mail is spam or not, if a patient is diabetic or not, if a customer will churn out or not — these are some examples of binary classification. Say our classification model tells us if the animal is a dog or a cat. The null hypothesis or positive statement for this example being “Dog” and the negative statement “Cat”.
无论邮件是否为垃圾邮件,是否为糖尿病患者,以及客户是否会流失-这些都是二进制分类的示例。 说我们的分类模型告诉我们动物是狗还是猫。 此示例的零假设或肯定陈述为“狗” , 否定陈述为“猫” 。
![Image for post](https://miro.medium.com/max/9999/1*ZHUPaG6Ls-ybTCAp9ex0Dw@2x.jpeg)
True Positive: Positive case correctly predicted as positive, i.e. a dog is predicted as ‘dog’.
真实阳性:阳性病例正确地预测为阳性,即一只狗被预测为“狗”。
True Negative: Negative case correctly predicted as negative, i.e. a cat is predicted as ‘cat’.