演示代码

\documentclass{article}
\usepackage{array}
\usepackage{multirow}

\newcommand\MyBox[2]{

 \fbox{\lower0.75cm
\vbox to 1.7cm{\vfil
 \hbox to 1.7cm{\hfil\parbox{1.4cm}{#1\\#2}\hfil}
 \vfil}%

 }%
}

\begin{document}

\noindent
\renewcommand\arraystretch{1.5}
\setlength\tabcolsep{0pt}
\begin{tabular}{c >{\bfseries}r @{\hspace{0.7em}}c @{\hspace{0.4em}}c @{\hspace{0.7em}}l}

 \multirow{10}{*}{\parbox{1.1cm}{\bfseries\raggedleft actual\\ value}} &
& \multicolumn{2}{c}{\bfseries Prediction outcome} & \\

 & & \bfseries p & \bfseries n & \bfseries total \\

 & p$'$ & \MyBox{True}{Positive} & \MyBox{False}{Negative} & P$'$ \\[2.4em]

 & n$'$ & \MyBox{False}{Positive} & \MyBox{True}{Negative} & N$'$ \\

 & total & P & N &
\end{tabular}

\end{document}

演示效果图

juzhen.jpg

选自:http://tex.stackexchange.com/questions/20267/how-to-construct-a-confusion-matrix-in-latex

点赞(0)

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部