Electron microscopy
 
PythonML
Precision and Recall Tradeoff
- Python Automation and Machine Learning for ICs -
- An Online Book -
Python Automation and Machine Learning for ICs                                                           http://www.globalsino.com/ICs/        


Chapter/Index: Introduction | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | Appendix

=================================================================================

Precision and recall are often in a tradeoff relationship, meaning that improving one may come at the expense of the other. This tradeoff is particularly evident when adjusting the threshold for classifying instances as positive or negative in a model. 

  1. High Precision

    A model with high precision is good at correctly identifying positive instances, but it may have a higher chance of missing some positive instances (false negatives). This is because it is being conservative in labeling instances as positive. 

  2. High Recall

    A model with high recall is good at capturing a large proportion of actual positive instances, but it may also have more false positives. This is because it is being more inclusive in labeling instances as positive. By adjusting the decision threshold, we can influence the balance between precision and recall. 

Finding the right balance depends on the specific goals and requirements of the application. In some scenarios, precision may be more critical, while in others, recall may take precedence. It's essential to consider the tradeoff based on the context and consequences of false positives and false negatives in a particular task. 

As an example, Figure 3600a shows the distribution of TN, FN, FP and TP of an example when the threshold is set at the middle.    

Figure 3600a. The distribution of TN, FN, FP and TP with the threshold at the middle. Here, TN = 9, FN = 3, TP = 8, and FP = 4. The TN is in red, while the TP is in green. 

Therefore, we can get,

Precision =  8/(8+4) = 66.7%

Recall = 9/(9+3) = 75.0% 

If we increase the threshold as shown in Figure 3600b, then we have more FN, but less FP.   

Figure 3600b. The distribution of TN, FN, FP and TP with a higher threshold. Here, TN = 12, FN = 4, TP = 7, and FP = 1. The TN is in red, while the TP is in green. 

Therefore, we can get,

Precision =  7/(7+1) = 87.5%

Recall = 12/(12+4) = 75.0% 

As we can see, the precision has been increased when the threshold increases; however, the recall has not changed.  In this case, the ones which have been classified to positive become more correct; however, it missed more positive examples.      

F1 Score can be used to find a suitable balance between precision and recall in a model.

 ============================================

         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         

 

 

 

 

 



















































 

 

 

 

 

=================================================================================