表格:在列内添加一列

表格:在列内添加一列

我需要在第 4 列和第 5 列中添加一列,以便可以进行 rmse 训练和 rmse 验证。有什么提示吗?

在此处输入图片描述

这是我的实际代码:

 \begin{table}[H]
\begin{center}

    \label{tab:table1}
    \begin{tabular}{|c|c|c|c|c|} % <-- Alignments: 1st column left, 2nd middle and 3rd right, with vertical lines in between
        \hline
         &  & & \textbf{Movielens 100K} &\textbf{Movielens 1M   }  \\
         $\lambda$ & $\gamma$ & Epochs & rmse & rmse  \\ 
        \hline
        0.01 & 0.006 & 35 & 0.9385 & \\ \hline
        0.01 & 0.003 & 34 &  & 0.9078 \\
        \hline
    \end{tabular}
\caption{.}
\end{center}
\end{table}

我的失败尝试:

    \begin{table}
\begin{center}

    \label{tab:table1}
    \begin{tabular}{|*{7}{c|}  % <-- Alignments: 1st column left, 2nd middle and 3rd right, with vertical lines in between
        \hline
        &  & & \textbf{Movielens 100K   } &\textbf{Movielens 1M }  \\
        $\lambda$ & $\gamma$ & Epochs & \multicolumn{2}{c}{ rmse }& rmse  \\ 
        \hline
        0.01 & 0.006 & 35 & 0.9385 & \\ \hline
        0.01 & 0.003 & 34 &  & 0.9078 \\
        \hline

    \end{tabular}
    \caption{}
\end{center}
\end{table}

在此处输入图片描述

答案1

评论太长了……我怀疑你在寻找类似的东西

在此处输入图片描述

但我不确定。请与上表相比,解释一下您的表格应该是什么样子。上表的 MWE 为:

\documentclass{article}
\begin{document}
    \begin{table}
\centering
    \caption{}
    \label{tab:table1}
    \begin{tabular}{|*{7}{c|}}  % <-- Alignments: 1st column left, 2nd middle and 3rd right, with vertical lines in between
   \hline
            &   &   & \multicolumn{2}{c|}{\textbf{Movielens 100K}}
                            & \multicolumn{2}{c|}{\textbf{Movielens 1M }}  \\
    \cline{4-7}
$\lambda$   & $\gamma$  & Epochs&  rmse     &       & rmse  &   \\
        \hline
0.01        & 0.006     & 35    & 0.9385    &       &       &   \\
    \hline
0.01        & 0.003     & 34    &           & 0.9078&       &   \\
    \hline
    \end{tabular}
\end{table}
\end{document}

相关内容