\begin{table}[!htbp]
\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
%\renewcommand\arraystretch{1.5}
%\setlength{\parskip}{2.0ex} % 段间距
%\renewcommand\theadset{\renewcommand\arraystretch{0.85}%
%\setlength\extrarowheight{0pt}}%行距
\renewcommand\theadgape{\Gape[1.5mm][1mm]}
\centering
\begin{tabular}{|p{1cm}<{\centering}|p{1cm}<{\centering}|p{1.5cm}<{\centering}|p{1.5cm}<{\centering}|}
\hline
\multicolumn{2}{|c|}{ \multirow{2}*{\thead{\tabincell{c}{Confusion\\Matrix}} } }& \multicolumn{2}{c|}{\thead{\tabincell{c}{Predicted Class}}} \\
\cline{3-4}
\multicolumn{2}{|c|}{}&\thead{1}&0\\
\hline
\multirow{2}*{\thead{\tabincell{c}{True\\Class}}}&\thead{1}&TP&FN\\
\cline{2-4}
&\thead{0}&FP&TN\\
\hline
\end{tabular}
\end{table}
https://blog.csdn.net/lishoubox/article/details/7300054
http://www.latexstudio.net/archives/2432.html
https://blog.csdn.net/lishoubox/article/details/7313921
https://blog.csdn.net/robert_chen1988/article/details/52695496
https://blog.csdn.net/wbl90/article/details/79821532
\begin{table}[!htbp]
\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
\renewcommand\arraystretch{1.2}
\renewcommand\tabcolsep{10pt}
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline
\multicolumn{2}{|c|}{ \multirow{2}*{ \tabincell{c}{Confusion\\Matrix} } }& \multicolumn{2}{c|}{\tabincell{c}{Predicted Class}} &\multirow{2}*{Total}\\
\cline{3-4}
\multicolumn{2}{|c|}{}&1&0&\\
\hline
\multirow{2}*{\tabincell{c}{True\\Class}}&1&TP&FN&\tabincell{c}{Actual\\Postive}\\
\cline{2-5}
&0&FP&TN&\tabincell{c}{Actual\\Negative}\\
\hline
\multicolumn{2}{|c|}{Total}&\tabincell{c}{Predicted\\Postive}&\tabincell{c}{Predicted\\Negative}&\tabincell{c}{TP+TN\\+FP+FN}\\
\hline
\end{tabular}
\end{table}
没大用,稍留存下