m = {{2, 0}, {1, 1}};
k = {"A", "B"};
MatrixPlot[m, ColorRules -> {0 -> White}, Frame -> True,
FrameLabel -> {"actual", "predicted"},
FrameTicks -> {{MapIndexed[{#2[[1]], #} &, k],
MapIndexed[{#2[[1]], #} &, Total@Transpose@m]},
{MapIndexed[{#2[[1]], #} &, Total[m]],
MapIndexed[{#2[[1]], #} &, k]}},
ColorFunction -> "Rainbow",
Epilog -> MapIndexed[Text[Style[#, 16], #2 - 1/2] &, Transpose@Reverse@m, {2}]]