Python Confusion Matrix With Examples - BTech Geeks Build the confusion matrix using the confusion_matrix () function by passing the given predicted and actual values list and labels as the arguments. Store it in another variable. Print the confusion matrix. Pass the predicted, actual values list and labels as the arguments to the classification_report () function of the metrics and store it in ...