mi_get_confusion function

Compute the confusion matrix for the predicted result.