A confusion matrix is a table used in machine learning classification tasks to evaluate the performance of a model. It displays the counts of true positives, true negatives, false positives, and false negatives for each class. This detailed breakdown helps identify where the model makes errors and guides improvements in accuracy, precision, recall, and overall effectiveness.