What is the relationship between the accuracy and the loss in deep learning?












4














I have created three different models using deep learning for multi-class classification and each model gave me a different accuracy and loss value. The results of the testing model as the following:




  • First Model: Accuracy: 98.1% Loss: 0.1882


  • Second Model: Accuracy: 98.5% Loss: 0.0997


  • Third Model: Accuracy: 99.1% Loss: 0.2544



My questions are:




  • What is the relationship between the loss and accuracy values?


  • Why the loss of the third model is the higher even though the accuracy is higher?











share|improve this question





























    4














    I have created three different models using deep learning for multi-class classification and each model gave me a different accuracy and loss value. The results of the testing model as the following:




    • First Model: Accuracy: 98.1% Loss: 0.1882


    • Second Model: Accuracy: 98.5% Loss: 0.0997


    • Third Model: Accuracy: 99.1% Loss: 0.2544



    My questions are:




    • What is the relationship between the loss and accuracy values?


    • Why the loss of the third model is the higher even though the accuracy is higher?











    share|improve this question



























      4












      4








      4


      2





      I have created three different models using deep learning for multi-class classification and each model gave me a different accuracy and loss value. The results of the testing model as the following:




      • First Model: Accuracy: 98.1% Loss: 0.1882


      • Second Model: Accuracy: 98.5% Loss: 0.0997


      • Third Model: Accuracy: 99.1% Loss: 0.2544



      My questions are:




      • What is the relationship between the loss and accuracy values?


      • Why the loss of the third model is the higher even though the accuracy is higher?











      share|improve this question















      I have created three different models using deep learning for multi-class classification and each model gave me a different accuracy and loss value. The results of the testing model as the following:




      • First Model: Accuracy: 98.1% Loss: 0.1882


      • Second Model: Accuracy: 98.5% Loss: 0.0997


      • Third Model: Accuracy: 99.1% Loss: 0.2544



      My questions are:




      • What is the relationship between the loss and accuracy values?


      • Why the loss of the third model is the higher even though the accuracy is higher?








      neural-network deep-learning keras tensorflow metric






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 14 at 12:46

























      asked Dec 14 at 9:08









      N.IT

      44111




      44111






















          3 Answers
          3






          active

          oldest

          votes


















          5














          There is no relationship between these two metrics.

          Loss can be seen as a distance between the true values of the problem and the values predicted by the model. Greater the loss is, more huge is the errors you made on the data.



          Accuracy can be seen as the number of error you made on the data.



          That means :

          - a low accuracy and huge loss means you made huge errors on a lot of data

          - a low accuracy but low loss means you made little errors on a lot of data

          - a great accuracy with low loss means you made low errors on a few data (best case)

          - your situation : a great accuracy but a huge loss, means you made huge errors on a few data.



          For you case, the third model can correctly predict more examples, but on those where it was wrong, it made more errors (the distance between true value and predicted values is more huge).



          NOTE :



          Don't forget that low or huge loss is a subjective metric, which depends on the problem and the data. It's a distance between the true value of the prediction, and the prediction made by the model. It depends also on the loss you use.



          Think :

          - If your data are between 0 and 1, a loss of 0.5 is huge, but if your data are between 0 and 255, an error of 0.5 is low.

          - Maybe think of cancer detection, and probability of detecting a cancer. Maybe an error of 0.1 is huge for this problem, whereas an error f 0.1 for image classification is fine.






          share|improve this answer























          • Thank you for your replying, if you mean by " data are between 0 and 1 or between 0 and 255 ", the scale !.. The image scale is 0-255. And the aim of the model is to classify images.
            – N.IT
            Dec 14 at 12:23












          • Do you have a reference for these information ?
            – N.IT
            Dec 14 at 12:32










          • @N.IT you did not specified in the question but my answer still stand as it is more general. Sorry I don't have reference for my claims.
            – Jérémy Blain
            Dec 14 at 13:23










          • "There is no relationship between these two metrics." isn't really accurate. Of course, there is a relationship between those two. Indeed, not a linear one. As @JérémyBlain noted, one can't really decide how well your model is based on the loss. That's why loss is mostly used to debug your training. Accuracy, better represents the real world application and is much more interpretable. But, you lose the information about the distances. A model with 2 classes that always predicts 0.51 for the true class would have the same accuracy as one that predicts 0.99.
            – oezguensi
            30 mins ago



















          2














          Actually, accuracy is a metric that can be applied to classification tasks only. It describes just what percentage of your test data are classified correctly. For example, you have binary classification cat or non-cats. If out of 100 test samples 95 is classified correctly (i.e. correctly determined if there's cat on the picture or not), then your accuracy is 95%. By the way, Confusion matrix describes your model much better then accuracy.



          Loss depends on how you predict classes for your classification problem. For example, your model use probabilities to predict binary class cat or non-cats between 1 and 0. So if probability of cat is 0.6, then the probability of non-cat is 0.4. In this case, picture is classified as cat. Loss will be sum of the difference between predicted probability of the real class of the test picture and 1. In reality log loss is used for binary classification, I just gave the idea of what loss is.






          share|improve this answer





















          • My model is a multi-class classification. Can I use loss as a measure?
            – N.IT
            Dec 14 at 12:49






          • 1




            Sure, but loss doesn't show performance of your model in classification problem. What matters is whether your test sample is classified correctly or not. Loss matters to you only if you need probabilities of each class, instead of just class labels. Loss also can help you to improve your model by looking at huge loss cases. What matters more in multiclass classification if whether your classes are balanced, because usually models are biased towards larger classes. For example, f1-macro score shows how you model performs relatively to all classes.
            – DmytroSytro
            Dec 14 at 12:56





















          1














          The other answers give good definitions of accuracy and loss. To answer your second question, consider this example:



          We have a problem of classifying images from a balanced dataset as containing either cats or dogs.
          Classifier 1 gives the right answer in 80/100 of cases, whereas classifier 2 gets it right in 95/100. Here, classifier 1 obviously has the higher accuracy.



          However, in the 80 of images classifier 1 gets right, it is extremely confident (for instance when it thinks an image is of a cat it is 100% sure that's the case), and in the 20 it gets wrong it was not at all confident (e.g. when it said a cat image contained a dog it was only 51% sure about that). In comparison, classifier 2 is extremely confident in its 5 wrong answers (it's 100% convinced that an image which actually shows a dog is a cat), and was not very confident about the 95 it got right. In this case, classifier 2 would have worse loss.






          share|improve this answer








          New contributor




          rlms is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.


















          • Thanks for the example, it is clear.
            – N.IT
            Dec 14 at 15:49











          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "557"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f42599%2fwhat-is-the-relationship-between-the-accuracy-and-the-loss-in-deep-learning%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          5














          There is no relationship between these two metrics.

          Loss can be seen as a distance between the true values of the problem and the values predicted by the model. Greater the loss is, more huge is the errors you made on the data.



          Accuracy can be seen as the number of error you made on the data.



          That means :

          - a low accuracy and huge loss means you made huge errors on a lot of data

          - a low accuracy but low loss means you made little errors on a lot of data

          - a great accuracy with low loss means you made low errors on a few data (best case)

          - your situation : a great accuracy but a huge loss, means you made huge errors on a few data.



          For you case, the third model can correctly predict more examples, but on those where it was wrong, it made more errors (the distance between true value and predicted values is more huge).



          NOTE :



          Don't forget that low or huge loss is a subjective metric, which depends on the problem and the data. It's a distance between the true value of the prediction, and the prediction made by the model. It depends also on the loss you use.



          Think :

          - If your data are between 0 and 1, a loss of 0.5 is huge, but if your data are between 0 and 255, an error of 0.5 is low.

          - Maybe think of cancer detection, and probability of detecting a cancer. Maybe an error of 0.1 is huge for this problem, whereas an error f 0.1 for image classification is fine.






          share|improve this answer























          • Thank you for your replying, if you mean by " data are between 0 and 1 or between 0 and 255 ", the scale !.. The image scale is 0-255. And the aim of the model is to classify images.
            – N.IT
            Dec 14 at 12:23












          • Do you have a reference for these information ?
            – N.IT
            Dec 14 at 12:32










          • @N.IT you did not specified in the question but my answer still stand as it is more general. Sorry I don't have reference for my claims.
            – Jérémy Blain
            Dec 14 at 13:23










          • "There is no relationship between these two metrics." isn't really accurate. Of course, there is a relationship between those two. Indeed, not a linear one. As @JérémyBlain noted, one can't really decide how well your model is based on the loss. That's why loss is mostly used to debug your training. Accuracy, better represents the real world application and is much more interpretable. But, you lose the information about the distances. A model with 2 classes that always predicts 0.51 for the true class would have the same accuracy as one that predicts 0.99.
            – oezguensi
            30 mins ago
















          5














          There is no relationship between these two metrics.

          Loss can be seen as a distance between the true values of the problem and the values predicted by the model. Greater the loss is, more huge is the errors you made on the data.



          Accuracy can be seen as the number of error you made on the data.



          That means :

          - a low accuracy and huge loss means you made huge errors on a lot of data

          - a low accuracy but low loss means you made little errors on a lot of data

          - a great accuracy with low loss means you made low errors on a few data (best case)

          - your situation : a great accuracy but a huge loss, means you made huge errors on a few data.



          For you case, the third model can correctly predict more examples, but on those where it was wrong, it made more errors (the distance between true value and predicted values is more huge).



          NOTE :



          Don't forget that low or huge loss is a subjective metric, which depends on the problem and the data. It's a distance between the true value of the prediction, and the prediction made by the model. It depends also on the loss you use.



          Think :

          - If your data are between 0 and 1, a loss of 0.5 is huge, but if your data are between 0 and 255, an error of 0.5 is low.

          - Maybe think of cancer detection, and probability of detecting a cancer. Maybe an error of 0.1 is huge for this problem, whereas an error f 0.1 for image classification is fine.






          share|improve this answer























          • Thank you for your replying, if you mean by " data are between 0 and 1 or between 0 and 255 ", the scale !.. The image scale is 0-255. And the aim of the model is to classify images.
            – N.IT
            Dec 14 at 12:23












          • Do you have a reference for these information ?
            – N.IT
            Dec 14 at 12:32










          • @N.IT you did not specified in the question but my answer still stand as it is more general. Sorry I don't have reference for my claims.
            – Jérémy Blain
            Dec 14 at 13:23










          • "There is no relationship between these two metrics." isn't really accurate. Of course, there is a relationship between those two. Indeed, not a linear one. As @JérémyBlain noted, one can't really decide how well your model is based on the loss. That's why loss is mostly used to debug your training. Accuracy, better represents the real world application and is much more interpretable. But, you lose the information about the distances. A model with 2 classes that always predicts 0.51 for the true class would have the same accuracy as one that predicts 0.99.
            – oezguensi
            30 mins ago














          5












          5








          5






          There is no relationship between these two metrics.

          Loss can be seen as a distance between the true values of the problem and the values predicted by the model. Greater the loss is, more huge is the errors you made on the data.



          Accuracy can be seen as the number of error you made on the data.



          That means :

          - a low accuracy and huge loss means you made huge errors on a lot of data

          - a low accuracy but low loss means you made little errors on a lot of data

          - a great accuracy with low loss means you made low errors on a few data (best case)

          - your situation : a great accuracy but a huge loss, means you made huge errors on a few data.



          For you case, the third model can correctly predict more examples, but on those where it was wrong, it made more errors (the distance between true value and predicted values is more huge).



          NOTE :



          Don't forget that low or huge loss is a subjective metric, which depends on the problem and the data. It's a distance between the true value of the prediction, and the prediction made by the model. It depends also on the loss you use.



          Think :

          - If your data are between 0 and 1, a loss of 0.5 is huge, but if your data are between 0 and 255, an error of 0.5 is low.

          - Maybe think of cancer detection, and probability of detecting a cancer. Maybe an error of 0.1 is huge for this problem, whereas an error f 0.1 for image classification is fine.






          share|improve this answer














          There is no relationship between these two metrics.

          Loss can be seen as a distance between the true values of the problem and the values predicted by the model. Greater the loss is, more huge is the errors you made on the data.



          Accuracy can be seen as the number of error you made on the data.



          That means :

          - a low accuracy and huge loss means you made huge errors on a lot of data

          - a low accuracy but low loss means you made little errors on a lot of data

          - a great accuracy with low loss means you made low errors on a few data (best case)

          - your situation : a great accuracy but a huge loss, means you made huge errors on a few data.



          For you case, the third model can correctly predict more examples, but on those where it was wrong, it made more errors (the distance between true value and predicted values is more huge).



          NOTE :



          Don't forget that low or huge loss is a subjective metric, which depends on the problem and the data. It's a distance between the true value of the prediction, and the prediction made by the model. It depends also on the loss you use.



          Think :

          - If your data are between 0 and 1, a loss of 0.5 is huge, but if your data are between 0 and 255, an error of 0.5 is low.

          - Maybe think of cancer detection, and probability of detecting a cancer. Maybe an error of 0.1 is huge for this problem, whereas an error f 0.1 for image classification is fine.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 14 at 9:40

























          answered Dec 14 at 9:14









          Jérémy Blain

          52419




          52419












          • Thank you for your replying, if you mean by " data are between 0 and 1 or between 0 and 255 ", the scale !.. The image scale is 0-255. And the aim of the model is to classify images.
            – N.IT
            Dec 14 at 12:23












          • Do you have a reference for these information ?
            – N.IT
            Dec 14 at 12:32










          • @N.IT you did not specified in the question but my answer still stand as it is more general. Sorry I don't have reference for my claims.
            – Jérémy Blain
            Dec 14 at 13:23










          • "There is no relationship between these two metrics." isn't really accurate. Of course, there is a relationship between those two. Indeed, not a linear one. As @JérémyBlain noted, one can't really decide how well your model is based on the loss. That's why loss is mostly used to debug your training. Accuracy, better represents the real world application and is much more interpretable. But, you lose the information about the distances. A model with 2 classes that always predicts 0.51 for the true class would have the same accuracy as one that predicts 0.99.
            – oezguensi
            30 mins ago


















          • Thank you for your replying, if you mean by " data are between 0 and 1 or between 0 and 255 ", the scale !.. The image scale is 0-255. And the aim of the model is to classify images.
            – N.IT
            Dec 14 at 12:23












          • Do you have a reference for these information ?
            – N.IT
            Dec 14 at 12:32










          • @N.IT you did not specified in the question but my answer still stand as it is more general. Sorry I don't have reference for my claims.
            – Jérémy Blain
            Dec 14 at 13:23










          • "There is no relationship between these two metrics." isn't really accurate. Of course, there is a relationship between those two. Indeed, not a linear one. As @JérémyBlain noted, one can't really decide how well your model is based on the loss. That's why loss is mostly used to debug your training. Accuracy, better represents the real world application and is much more interpretable. But, you lose the information about the distances. A model with 2 classes that always predicts 0.51 for the true class would have the same accuracy as one that predicts 0.99.
            – oezguensi
            30 mins ago
















          Thank you for your replying, if you mean by " data are between 0 and 1 or between 0 and 255 ", the scale !.. The image scale is 0-255. And the aim of the model is to classify images.
          – N.IT
          Dec 14 at 12:23






          Thank you for your replying, if you mean by " data are between 0 and 1 or between 0 and 255 ", the scale !.. The image scale is 0-255. And the aim of the model is to classify images.
          – N.IT
          Dec 14 at 12:23














          Do you have a reference for these information ?
          – N.IT
          Dec 14 at 12:32




          Do you have a reference for these information ?
          – N.IT
          Dec 14 at 12:32












          @N.IT you did not specified in the question but my answer still stand as it is more general. Sorry I don't have reference for my claims.
          – Jérémy Blain
          Dec 14 at 13:23




          @N.IT you did not specified in the question but my answer still stand as it is more general. Sorry I don't have reference for my claims.
          – Jérémy Blain
          Dec 14 at 13:23












          "There is no relationship between these two metrics." isn't really accurate. Of course, there is a relationship between those two. Indeed, not a linear one. As @JérémyBlain noted, one can't really decide how well your model is based on the loss. That's why loss is mostly used to debug your training. Accuracy, better represents the real world application and is much more interpretable. But, you lose the information about the distances. A model with 2 classes that always predicts 0.51 for the true class would have the same accuracy as one that predicts 0.99.
          – oezguensi
          30 mins ago




          "There is no relationship between these two metrics." isn't really accurate. Of course, there is a relationship between those two. Indeed, not a linear one. As @JérémyBlain noted, one can't really decide how well your model is based on the loss. That's why loss is mostly used to debug your training. Accuracy, better represents the real world application and is much more interpretable. But, you lose the information about the distances. A model with 2 classes that always predicts 0.51 for the true class would have the same accuracy as one that predicts 0.99.
          – oezguensi
          30 mins ago











          2














          Actually, accuracy is a metric that can be applied to classification tasks only. It describes just what percentage of your test data are classified correctly. For example, you have binary classification cat or non-cats. If out of 100 test samples 95 is classified correctly (i.e. correctly determined if there's cat on the picture or not), then your accuracy is 95%. By the way, Confusion matrix describes your model much better then accuracy.



          Loss depends on how you predict classes for your classification problem. For example, your model use probabilities to predict binary class cat or non-cats between 1 and 0. So if probability of cat is 0.6, then the probability of non-cat is 0.4. In this case, picture is classified as cat. Loss will be sum of the difference between predicted probability of the real class of the test picture and 1. In reality log loss is used for binary classification, I just gave the idea of what loss is.






          share|improve this answer





















          • My model is a multi-class classification. Can I use loss as a measure?
            – N.IT
            Dec 14 at 12:49






          • 1




            Sure, but loss doesn't show performance of your model in classification problem. What matters is whether your test sample is classified correctly or not. Loss matters to you only if you need probabilities of each class, instead of just class labels. Loss also can help you to improve your model by looking at huge loss cases. What matters more in multiclass classification if whether your classes are balanced, because usually models are biased towards larger classes. For example, f1-macro score shows how you model performs relatively to all classes.
            – DmytroSytro
            Dec 14 at 12:56


















          2














          Actually, accuracy is a metric that can be applied to classification tasks only. It describes just what percentage of your test data are classified correctly. For example, you have binary classification cat or non-cats. If out of 100 test samples 95 is classified correctly (i.e. correctly determined if there's cat on the picture or not), then your accuracy is 95%. By the way, Confusion matrix describes your model much better then accuracy.



          Loss depends on how you predict classes for your classification problem. For example, your model use probabilities to predict binary class cat or non-cats between 1 and 0. So if probability of cat is 0.6, then the probability of non-cat is 0.4. In this case, picture is classified as cat. Loss will be sum of the difference between predicted probability of the real class of the test picture and 1. In reality log loss is used for binary classification, I just gave the idea of what loss is.






          share|improve this answer





















          • My model is a multi-class classification. Can I use loss as a measure?
            – N.IT
            Dec 14 at 12:49






          • 1




            Sure, but loss doesn't show performance of your model in classification problem. What matters is whether your test sample is classified correctly or not. Loss matters to you only if you need probabilities of each class, instead of just class labels. Loss also can help you to improve your model by looking at huge loss cases. What matters more in multiclass classification if whether your classes are balanced, because usually models are biased towards larger classes. For example, f1-macro score shows how you model performs relatively to all classes.
            – DmytroSytro
            Dec 14 at 12:56
















          2












          2








          2






          Actually, accuracy is a metric that can be applied to classification tasks only. It describes just what percentage of your test data are classified correctly. For example, you have binary classification cat or non-cats. If out of 100 test samples 95 is classified correctly (i.e. correctly determined if there's cat on the picture or not), then your accuracy is 95%. By the way, Confusion matrix describes your model much better then accuracy.



          Loss depends on how you predict classes for your classification problem. For example, your model use probabilities to predict binary class cat or non-cats between 1 and 0. So if probability of cat is 0.6, then the probability of non-cat is 0.4. In this case, picture is classified as cat. Loss will be sum of the difference between predicted probability of the real class of the test picture and 1. In reality log loss is used for binary classification, I just gave the idea of what loss is.






          share|improve this answer












          Actually, accuracy is a metric that can be applied to classification tasks only. It describes just what percentage of your test data are classified correctly. For example, you have binary classification cat or non-cats. If out of 100 test samples 95 is classified correctly (i.e. correctly determined if there's cat on the picture or not), then your accuracy is 95%. By the way, Confusion matrix describes your model much better then accuracy.



          Loss depends on how you predict classes for your classification problem. For example, your model use probabilities to predict binary class cat or non-cats between 1 and 0. So if probability of cat is 0.6, then the probability of non-cat is 0.4. In this case, picture is classified as cat. Loss will be sum of the difference between predicted probability of the real class of the test picture and 1. In reality log loss is used for binary classification, I just gave the idea of what loss is.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 14 at 12:41









          DmytroSytro

          1337




          1337












          • My model is a multi-class classification. Can I use loss as a measure?
            – N.IT
            Dec 14 at 12:49






          • 1




            Sure, but loss doesn't show performance of your model in classification problem. What matters is whether your test sample is classified correctly or not. Loss matters to you only if you need probabilities of each class, instead of just class labels. Loss also can help you to improve your model by looking at huge loss cases. What matters more in multiclass classification if whether your classes are balanced, because usually models are biased towards larger classes. For example, f1-macro score shows how you model performs relatively to all classes.
            – DmytroSytro
            Dec 14 at 12:56




















          • My model is a multi-class classification. Can I use loss as a measure?
            – N.IT
            Dec 14 at 12:49






          • 1




            Sure, but loss doesn't show performance of your model in classification problem. What matters is whether your test sample is classified correctly or not. Loss matters to you only if you need probabilities of each class, instead of just class labels. Loss also can help you to improve your model by looking at huge loss cases. What matters more in multiclass classification if whether your classes are balanced, because usually models are biased towards larger classes. For example, f1-macro score shows how you model performs relatively to all classes.
            – DmytroSytro
            Dec 14 at 12:56


















          My model is a multi-class classification. Can I use loss as a measure?
          – N.IT
          Dec 14 at 12:49




          My model is a multi-class classification. Can I use loss as a measure?
          – N.IT
          Dec 14 at 12:49




          1




          1




          Sure, but loss doesn't show performance of your model in classification problem. What matters is whether your test sample is classified correctly or not. Loss matters to you only if you need probabilities of each class, instead of just class labels. Loss also can help you to improve your model by looking at huge loss cases. What matters more in multiclass classification if whether your classes are balanced, because usually models are biased towards larger classes. For example, f1-macro score shows how you model performs relatively to all classes.
          – DmytroSytro
          Dec 14 at 12:56






          Sure, but loss doesn't show performance of your model in classification problem. What matters is whether your test sample is classified correctly or not. Loss matters to you only if you need probabilities of each class, instead of just class labels. Loss also can help you to improve your model by looking at huge loss cases. What matters more in multiclass classification if whether your classes are balanced, because usually models are biased towards larger classes. For example, f1-macro score shows how you model performs relatively to all classes.
          – DmytroSytro
          Dec 14 at 12:56













          1














          The other answers give good definitions of accuracy and loss. To answer your second question, consider this example:



          We have a problem of classifying images from a balanced dataset as containing either cats or dogs.
          Classifier 1 gives the right answer in 80/100 of cases, whereas classifier 2 gets it right in 95/100. Here, classifier 1 obviously has the higher accuracy.



          However, in the 80 of images classifier 1 gets right, it is extremely confident (for instance when it thinks an image is of a cat it is 100% sure that's the case), and in the 20 it gets wrong it was not at all confident (e.g. when it said a cat image contained a dog it was only 51% sure about that). In comparison, classifier 2 is extremely confident in its 5 wrong answers (it's 100% convinced that an image which actually shows a dog is a cat), and was not very confident about the 95 it got right. In this case, classifier 2 would have worse loss.






          share|improve this answer








          New contributor




          rlms is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.


















          • Thanks for the example, it is clear.
            – N.IT
            Dec 14 at 15:49
















          1














          The other answers give good definitions of accuracy and loss. To answer your second question, consider this example:



          We have a problem of classifying images from a balanced dataset as containing either cats or dogs.
          Classifier 1 gives the right answer in 80/100 of cases, whereas classifier 2 gets it right in 95/100. Here, classifier 1 obviously has the higher accuracy.



          However, in the 80 of images classifier 1 gets right, it is extremely confident (for instance when it thinks an image is of a cat it is 100% sure that's the case), and in the 20 it gets wrong it was not at all confident (e.g. when it said a cat image contained a dog it was only 51% sure about that). In comparison, classifier 2 is extremely confident in its 5 wrong answers (it's 100% convinced that an image which actually shows a dog is a cat), and was not very confident about the 95 it got right. In this case, classifier 2 would have worse loss.






          share|improve this answer








          New contributor




          rlms is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.


















          • Thanks for the example, it is clear.
            – N.IT
            Dec 14 at 15:49














          1












          1








          1






          The other answers give good definitions of accuracy and loss. To answer your second question, consider this example:



          We have a problem of classifying images from a balanced dataset as containing either cats or dogs.
          Classifier 1 gives the right answer in 80/100 of cases, whereas classifier 2 gets it right in 95/100. Here, classifier 1 obviously has the higher accuracy.



          However, in the 80 of images classifier 1 gets right, it is extremely confident (for instance when it thinks an image is of a cat it is 100% sure that's the case), and in the 20 it gets wrong it was not at all confident (e.g. when it said a cat image contained a dog it was only 51% sure about that). In comparison, classifier 2 is extremely confident in its 5 wrong answers (it's 100% convinced that an image which actually shows a dog is a cat), and was not very confident about the 95 it got right. In this case, classifier 2 would have worse loss.






          share|improve this answer








          New contributor




          rlms is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          The other answers give good definitions of accuracy and loss. To answer your second question, consider this example:



          We have a problem of classifying images from a balanced dataset as containing either cats or dogs.
          Classifier 1 gives the right answer in 80/100 of cases, whereas classifier 2 gets it right in 95/100. Here, classifier 1 obviously has the higher accuracy.



          However, in the 80 of images classifier 1 gets right, it is extremely confident (for instance when it thinks an image is of a cat it is 100% sure that's the case), and in the 20 it gets wrong it was not at all confident (e.g. when it said a cat image contained a dog it was only 51% sure about that). In comparison, classifier 2 is extremely confident in its 5 wrong answers (it's 100% convinced that an image which actually shows a dog is a cat), and was not very confident about the 95 it got right. In this case, classifier 2 would have worse loss.







          share|improve this answer








          New contributor




          rlms is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          share|improve this answer



          share|improve this answer






          New contributor




          rlms is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          answered Dec 14 at 14:35









          rlms

          1112




          1112




          New contributor




          rlms is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          New contributor





          rlms is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          rlms is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.












          • Thanks for the example, it is clear.
            – N.IT
            Dec 14 at 15:49


















          • Thanks for the example, it is clear.
            – N.IT
            Dec 14 at 15:49
















          Thanks for the example, it is clear.
          – N.IT
          Dec 14 at 15:49




          Thanks for the example, it is clear.
          – N.IT
          Dec 14 at 15:49


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Data Science Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f42599%2fwhat-is-the-relationship-between-the-accuracy-and-the-loss-in-deep-learning%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Category:香港粉麵

          List *all* the tuples!

          Channel [V]