liveBook · Manning

Confusion matrix

As explained in Effective Conversational AI

A confusion matrix is a tabular summary comparing a classifier's predicted categories with the authoritative categories for evaluation examples.

A confusion matrix compares predicted intents with the correct intents for evaluation utterances, exposing where a classifier selects the wrong category or misses the right one. section 5.1.1

Read each prediction through four possible outcomes:

  • True positive: the prediction matches the correct intent. section 5.1.1
  • False positive: the classifier selects an intent that is incorrect, creating over-selection. section 5.1.1
  • False negative: the classifier fails to select the correct intent, creating under-selection. section 5.1.1
  • True negative: the prediction does not match an incorrect intent. section 5.1.1

Request_Agent evaluation

Seven utterances include four correct Request_Agent predictions, two false positives, and one missed match. This produces 80% recall, 66% precision, and a 0.72 F1 score. section 5.1.1

Figure 5.1 In a 2 × 2 confusion matrix, the possible outcomes are derived by comparing the predicted intent to the actual intent.
figure

Inspect the 2 × 2 layout that derives outcomes by comparing predicted and actual intents. section 5.1.1

How Effective Conversational AI covers it

How deep it goes
Defines four outcomes and works through recall, precision, and F1 calculations using an intent-level evaluation example.
Examples
Uses Request_Agent utterances such as “Speak with an agent,” “What can I ask you,” and “Somebody hit my car.”
What it assumes
Assumes labeled test utterances and classifier intents, while defining the prediction outcomes needed for evaluation.
What you can do after
Diagnose over-selection and under-selection by interpreting prediction outcomes and calculating intent-level evaluation metrics.
How it connects
Connects classifier evaluation with intents, recall, precision, F1 score, true positives, false positives, and false negatives.

Also explained in

Compare how 14 books explain confusion matrix →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Effective Conversational AI. The section links point to the parts of the book it draws on.