In the previous chapters, we have been using the accuracy rate (accuracy) to evaluate the performance of the model, which is usually a good choice. In addition, there are many evaluation indicators, such as precision (precision), recall rate (recall) and F1 value (F1-score).
Confusion matrix
Before explaining the different evaluation indicators, let's start by learning a concept: The confusion matrix (confusion matrix), which shows the matrix of the learning algorithm's performance. The confusion matrix is a square matrix in which a classifier's TP (true positive), TN (True negative), FP (False positive), and FN (false negative) are recorded:
The calculation of four indicators is not complicated, but can not hand calculate of course not hand, Sklearn provides the Confusion_matrix function:
Python Machine learning Chinese catalog (http://www.aibbt.com/a/20787.html)
Reprint please specify the source, Python machine learning (http://www.aibbt.com/a/pythonmachinelearning/)
Python machine learning: 6.6 Different performance evaluation indicators