# confusion matrix with [ ] delimeters

I would like to make a confusion matrix that looks like the one on the picture. How can I achive this? Thanks

% arara: pdflatex

\documentclass{article}
\usepackage{blkarray}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{mathtools}

\begin{document}
$\renewcommand{\arraystretch}{1.6} \begin{blockarray}{c@{}ccc} &&\BAmulticolumn{2}{c}{\text{observed}}\\[-2\jot] && 0 & 1 \\ \begin{block}{c@{\hspace{.6em}}c[cc]} \multirow{2}{*}{\rotatebox[origin=c]{90}{predicted}} & 0 & a=1 & b=2\\ & 1 & c=3 & d=4 \\ \end{block} \end{blockarray}$
\end{document}


• @OlgaLyashevska Glad to hear that. – LaRiFaRi Jul 13 '15 at 14:11