Python Machine Learning Cookbook(Second Edition)
上QQ阅读APP看书,第一时间看更新

How it works...

A confusion matrix displays information about the actual and predicted classifications made by a model. The performance of such systems is evaluated with the help of data in the matrix.

The following table shows the confusion matrix for a two-class classifier:

 

The entries in the confusion matrix have the following meanings:

  • TP is the number of correct predictions that an instance is positive
  • FN is the number of incorrect predictions that an instance is negative
  • FP is the number of incorrect predictions that an instance is positive
  • TN is the number of correct predictions that an instance is negative