如何解释机器学习模型的损失和准确性 [英] How to interpret loss and accuracy for a machine learning model

本文介绍了如何解释机器学习模型的损失和准确性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用Theano或Tensorflow训练我的神经网络时,它们将在每个时期报告一个称为损失"的变量.

我应该如何解释该变量?更高的损失是好是坏,这对我的神经网络的最终性能(准确性)意味着什么?

解决方案

损失越低,模型越好(除非模型过度适合训练数据).损失是根据训练验证计算的,其互操作性是模型在这两套模型上的表现.与准确性不同,损失不是百分比.它是对每个示例在训练或验证集中所犯错误的总和.

对于神经网络,损失通常为

在降低损失值的同时,还有一些细微之处.例如,您可能会遇到过度拟合的问题,其中模型记忆"了训练示例,并且对测试集无效.如果您没有使用常规化,也会发生过度拟合一个非常复杂的模型(自由参数 W 的数量很大)或数据点 N 的数量很低.

When I trained my neural network with Theano or Tensorflow, they will report a variable called "loss" per epoch.

How should I interpret this variable? Higher loss is better or worse, or what does it mean for the final performance (accuracy) of my neural network?

解决方案

The lower the loss, the better a model (unless the model has over-fitted to the training data). The loss is calculated on training and validation and its interperation is how well the model is doing for these two sets. Unlike accuracy, loss is not a percentage. It is a summation of the errors made for each example in training or validation sets.

In the case of neural networks, the loss is usually negative log-likelihood and residual sum of squares for classification and regression respectively. Then naturally, the main objective in a learning model is to reduce (minimize) the loss function's value with respect to the model's parameters by changing the weight vector values through different optimization methods, such as backpropagation in neural networks.

Loss value implies how well or poorly a certain model behaves after each iteration of optimization. Ideally, one would expect the reduction of loss after each, or several, iteration(s).

The accuracy of a model is usually determined after the model parameters are learned and fixed and no learning is taking place. Then the test samples are fed to the model and the number of mistakes (zero-one loss) the model makes are recorded, after comparison to the true targets. Then the percentage of misclassification is calculated.

For example, if the number of test samples is 1000 and model classifies 952 of those correctly, then the model's accuracy is 95.2%.

There are also some subtleties while reducing the loss value. For instance, you may run into the problem of over-fitting in which the model "memorizes" the training examples and becomes kind of ineffective for the test set. Over-fitting also occurs in cases where you do not employ a regularization, you have a very complex model (the number of free parameters W is large) or the number of data points N is very low.

这篇关于如何解释机器学习模型的损失和准确性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆