# [Math] Confused About Calculating Confusion Matrix

matricesprobabilitystatistics

I am having confusion while calculating confusion matrix. So let me say, I programmer with very basic idea of probability etc. when I trained a Machine Learning model using Microsoft Azure, I got something like this:

This seems good and what I expected it to look like. However, when Google Prediction API generated it, it did something like this:

The last line is the row total of the data. How do I convert this to something similar to the one above?

Thanks.

Personally, I would prefer to use the count matrix as it loses less information and avoids the ambiguity of in which direction the numbers add up to $100\%$. Wikipedia's example also uses counts