机器学习模型的性能指标

There are various metrics that we can use to evaluate the performance of ML algorithms, classification as well as regression algorithms. We must carefully choose the metrics for evaluating ML performance because,

我们可以使用各种指标来评估ML算法,分类以及回归算法的性能。 我们必须谨慎选择评估ML性能的指标,因为,

  • How the performance of ML algorithms is measured and compared will be dependent entirely on the metric we choose.

    ML算法的性能如何衡量和比较将完全取决于我们选择的指标。
  • How we weight the importance of various characteristics in the result will be influenced completely by the metric we choose.

    我们如何权衡各种特征在结果中的重要性,将完全取决于我们选择的指标。

The metrics that you choose to evaluate your machine learning model are very important. Choice of metrics influences how the performance of machine learning algorithms is measured and compared.

您选择用来评估机器学习模型的指标非常重要。 度量标准的选择会影响如何衡量和比较机器学习算法的性能。

内容 (Contents)

1.Performance Metrics for Classification Problems

1.分类问题的绩效指标

2.Performance Metrics for Regression Problems

2回归问题的绩效指标

3.Distribution of Errors

3,错误分布

分类问题的绩效指标 (Performance Metrics for Classification Problems)

1.准确性 (1. Accuracy)

Accuracy is the most intuitive performance measure and it is simply a ratio of correctly predicted observation to the total observations.

准确性是最直观的性能指标,它只是正确预测的观测值与总观测值的比率。

As a heuristic, or rule of thumb, accuracy can tell us immediately whether a model is being trained correctly and how it may perform generally. However, it does not give detailed information regarding its application to the problem.

作为一种启发法或经验法则,准确性可以立即告诉我们模型是否被正确训练以及其总体性能如何。 但是,它没有提供有关此问题的应用的详细信息。

Image for post

If we have high accuracy then our model is best. Yes, accuracy is a great measure but only when we have symmetric datasets where values of positive and negative classes are almost the same.

如果我们具有高精度,那么我们的模型是最好的。 是的,准确性是一个很好的衡量标准,但是只有当我们拥有对称数据集时,正类别和负类别的值几乎相同。

When data is imbalanced, Accuracy is not the best measure and accuracy cannot use the probability score.

数据不平衡时 ,准确性不是最佳度量,准确性也不能使用概率分数。

Ex: In our Amazon food review sentiment analysis example with 100 reviews, 10 people have said the review is positive. Let’s assume our model is very bad and predicts every review is positive. For this, it has classified those 90 people negative reviews as positive and 10 positive reviews as negative reviews. Now even though the model is terrible at predicting reviews, The accuracy of such a bad model is also 90%.

例:在我们的100条评论的亚马逊食品评论情绪分析示例中,有10个人说评论是肯定的。 让我们假设我们的模型非常糟糕,并预测每个评论都是正面的。 为此,它将90个人的负面评论归为正面,将10个人的负面评论归为负面。 现在,即使该模型在预测评论方面很糟糕,这种不良模型的准确性也高达90%。

2.混淆矩阵 (2. Confusion Matrix)

The Confusion matrix is one of the most intuitive and easiest metrics used for finding the correctness and accuracy of the model. It is used for the Classification problem where the output can be of two or more types of classes.

混淆矩阵是用于查找模型的正确性和准确性的最直观,最简单的指标之一。 它用于分类问题,其中输出可以是两种或多种类型的类。

Confusion Matrix cannot process the probability score.

混淆矩阵无法处理概率得分。

A confusion matrix is an N X N matrix, where N is the number of classes being predicted. For the problem in hand, if we have N=2, and hence we get a 2 X 2 matrix.

混淆矩阵是NXN矩阵,其中N是要预测的类别数。 对于手头的问题,如果我们有N = 2,则得到2 X 2矩阵。

Let’s assume in our Amazon Food reviews label to our target variable:1: When a person says the review is Positive.

让我们在我们的Amazon Food评论标签中假设目标变量为: 1 :当某人说评论为肯定。

0: When a person says the review is Negative.

0:当某人说评论为负面时。

The confusion matrix is a table with two dimensions (“Actual” and “Predicted”), and sets of “classes” in both dimensions. Our Actual classifications are rows and Predicted ones are Columns.

混淆矩阵是一个具有两个维度(“实际”和“预测”)的表,并且在两个维度中都有“类别”的集合。 我们的实际分类是行,预测的是列。

Image for post

The Confusion matrix in itself is not a performance measure as such, but almost all of the performance metrics are based on the Confusion Matrix and the numbers inside it.

混淆矩阵本身并不是一个性能指标,但是几乎所有性能指标都是基于混淆矩阵及其内部数字的。

Explanation of the terms associated with confusion matrix are as follows,

与混淆矩阵相关的术语的解释如下,

True Negatives (TN) − It is the case when both the actual class and predicted class of data point is 0.

真负数(TN) -数据点的实际类别和预测类别均为0的情况。

Ex: The case where a review is actually negative(0) and the model classifying this review as negative(0) comes under True Negative.

例如:评论实际上是负面的(0),并且将该评论归为负面(0)的模型属于True Negative。

False Positives (FP) − It is the case when the actual class of data point is 0 and the predicted class of data point is 1.

误报(FP) -实际数据点类别为0而预测数据点类别为1。

Ex: The case where a review is actually negative(0) and the model classifying this review as positive(1) comes under False Positive.

例如:评论实际上是负面的(0),并且将该评论归为正面(1)的模型属于误报。

False Negatives (FN) − It is the case when the actual class of data point is 1 and the predicted class of data point is 0.

假阴性(FN) -数据点的实际类别为1而数据点的预测类别为0的情况。

Ex: The case where a review is actually positive(1) and the model classifying this review as negative(0) comes under False Negative.

例如:评论实际上是肯定的(1)并且将该评论归为否定(0)的模型属于假否定。

True Positives (TP) − It is the case when both the actual class and predicted class of data point is 1.

真实正值(TP) -数据点的实际类别和预测类别均为1。

Ex: The case where a review is actually positive(1) and the model classifying this review as positive(1) comes under True positive.

例:评论实际上是肯定的(1)且将该评论归为肯定(1)的模型属于“真正肯定”。

N is the total number of negatives in our given data and P is the total number of positives in our data shown in the below image.

N是给定数据中的负数总数,P是下图中所示的数据中的正数总数。

Image for post

Accuracy in terms of the confusion matrix given by in classification problems is the number of correct predictions made by the model over all kinds of predictions made.

在分类问题中给出的混淆矩阵方面的准确性是模型在做出的

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值