How to interpret loss and accuracy for a machine learning model [closed] Ask Question

How to interpret loss and accuracy for a machine learning model [closed] Ask Question

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?

ベストアンサー1

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%.

ここに画像の説明を入力してください

損失値を減らす際には、微妙な点もいくつかあります。たとえば、モデルがトレーニング例を「記憶」してしまい、テスト セットに対して効果がなくなるという過剰適合の問題に遭遇する場合があります。過剰適合は、正規化を使用していない場合、モデルが非常に複雑である場合 (自由パラメータの数Wが多い場合)、またはデータ ポイントの数がN非常に少ない場合にも発生します。

おすすめ記事