Answers.Body: <p>When labels are 0 or 1, the common threshold that is applied is 0.5</p>
  <p>However from a theory standpoint there is no ideal threshold value. For example, if the dataset contains imbalanced classes, a threshold that reflects this imbalance may do better.</p>
  <p>So 0.5 is commonly used and empirically good, but there are no guarantees it will be best.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-26T23:29:40.660Z
Answers.LastActivityDate: 2023-02-26T23:29:40.660Z
Answers.UserDisplayName: chessprogrammer
Body: <p>Let there is a dataset whose labels are <code>{0,1}</code>, and we need to train a neural network model for the logistic regression problem. I need to calculate the accuracy. To do that, I can't compare the label with the predicted value, because they are not the same at all. The predicted value might be 0.9452 while the corresponding label is 1. I would like to know what is the appropriate value as the maximum difference between the label and the predicted value?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-02-26T17:35:22.937Z
Comments.Text: 0.5 is already a good value in most cases. In cases where false positive is better than false negative, you can lower that down.
Comments.UserDisplayName: Minh-Long Luu
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-11-02T22:00:53.263Z
Comments.Text: It would be subjective. How is your accuracy value of test dataset in different threshold? I think it also depends on structure of neural network. What neural network models did you try?
Comments.UserDisplayName: Cloud Cho
Tags: <neural-networks><machine-learning>
Title: What is the appropriate threshold for accuracy in logistic regression?
UserDisplayName: M a m a D
ThreadText: # What is the appropriate threshold for accuracy in logistic regression?
  
  (Asked by: username_0 on 2023-02-26)
  
  Let there is a dataset whose labels are `{0,1}`, and we need to train a neural network model for the logistic regression problem. I need to calculate the accuracy. To do that, I can't compare the label with the predicted value, because they are not the same at all. The predicted value might be 0.9452 while the corresponding label is 1. I would like to know what is the appropriate value as the maximum difference between the label and the predicted value?
  
  **Tags:** neural-networks, machine-learning
  
  > **Comments:**
  > **username_1**: 0.5 is already a good value in most cases. In cases where false positive is better than false negative, you can lower that down.  
  > **username_2**: It would be subjective. How is your accuracy value of test dataset in different threshold? I think it also depends on structure of neural network. What neural network models did you try?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2023-02-26. Score: 3 | Accepted answer
  
  When labels are 0 or 1, the common threshold that is applied is 0.5
  
  However from a theory standpoint there is no ideal threshold value. For example, if the dataset contains imbalanced classes, a threshold that reflects this imbalance may do better.
  
  So 0.5 is commonly used and empirically good, but there are no guarantees it will be best.
  
  
  ---
  
  