Recall & Review
beginner
What is a confusion matrix in machine learning?
A confusion matrix is a table that shows how well a classification model performs by comparing actual labels with predicted labels. It helps to see where the model makes correct and incorrect predictions.
Click to reveal answer
beginner
What do the rows and columns represent in a confusion matrix?
Rows represent the actual classes, and columns represent the predicted classes. Each cell shows the count of predictions for that actual-predicted pair.
Click to reveal answer
beginner
Why is visualizing a confusion matrix helpful?
Visualization makes it easier to quickly understand the model's performance, spot which classes are confused, and identify patterns of errors.
Click to reveal answer
intermediate
Which TensorFlow and Python tools can be used to create a confusion matrix visualization?
You can use TensorFlow to get predictions and true labels, then use scikit-learn's confusion_matrix function to compute it, and matplotlib or seaborn to visualize it as a heatmap.
Click to reveal answer
beginner
What does the diagonal of a confusion matrix represent?
The diagonal cells show the number of correct predictions for each class. Higher values on the diagonal mean better model accuracy.
Click to reveal answer
In a confusion matrix, what does a high value off the diagonal indicate?
✗ Incorrect
Values off the diagonal represent wrong predictions where the model confused one class for another.
Which Python library is commonly used to plot confusion matrices as heatmaps?
✗ Incorrect
Seaborn provides easy-to-use heatmap functions ideal for visualizing confusion matrices.
What function from scikit-learn computes the confusion matrix?
✗ Incorrect
The confusion_matrix() function computes the confusion matrix from true and predicted labels.
What does the diagonal of a confusion matrix represent?
✗ Incorrect
The diagonal cells show counts of correct predictions for each class.
Why might you normalize a confusion matrix before visualization?
✗ Incorrect
Normalization helps compare performance across classes with different numbers of samples.
Explain how to create and visualize a confusion matrix using TensorFlow and Python libraries.
Think about the steps from model output to visualization.
You got /4 concepts.
Describe why confusion matrix visualization is important for evaluating classification models.
Consider how visualization helps in real-life model analysis.
You got /4 concepts.