Confusion matrix

A confusion matrix is a technique for summarizing the performance of a classification algorithm. It provides information of what the classification model is getting right and what types of errors it is making. Predictions of the results on a classification problem are usually visualized by the following matrix:

For illustration we are using a two-class problem, and we have to select specific outcome from observations and define it as a base case (for example, it rains versus alternative (rejected) no rain). It becomes a reference point for evaluating our model with the test data.

  • True Positive for correctly predicted values (correct prediction)
  • False Positive for incorrectly predicted values (incorrect prediction)
  • True Negative for correctly rejected values (correct prediction)
  • False Negative for incorrectly rejected values (incorrect prediction)

There are multiple ways to measure the performance of the model. The Key classification accuracy indicator is called precision.

Precision is defined as the proportion of positive predictions to the number of observations that are actually positive. We can express it as follows:

Recall tells us what is the proportion of actually positive observations predicted as positive:

F1-score combines precision and recall to measure the test accuracy. It can be interpreted as weighted average of precision and recall with its best value at 1 and the worst at 0:

Support is the number of observations that are predicted in a particular class.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset