次の表をどのように設計しますか?

次の表をどのように設計しますか?

私の目標は、データ セット R1、R2、R3 でトレーニングされたモデルによって達成されたテスト精度を簡潔に提示することです。これを実現するために、データ セット全体を一度に開始するのではなく、3 つのセットのそれぞれから徐々に多くのデータを取り込みながら、複数のフェーズでモデルをトレーニングしました。 ここに画像の説明を入力してください

どう思いますか?各モデルごとにデータセット名を繰り返さなくても済むかどうかはよくわかりません。アドバイスをいただければ幸いです。

答え1

私が主にお勧めするのは、資料を転置して、10 列以上ではなく 4 列または 5 列だけにすることです。

ここに画像の説明を入力してください

\documentclass{article}
\usepackage{array,booktabs}
\usepackage[flushleft]{threeparttable}

\begin{document}

\begin{table}[h]
\centering
\begin{threeparttable}
\caption{Test accuracies achieved by models trained on datasets R1, R2, and~R3}
\begin{tabular}{@{} ll ccc @{}}
\toprule
\multicolumn{2}{@{}l@{}}{Model} & \multicolumn{3}{c@{}}{Training Phases} \\
\cmidrule(l){3-5} 
&& Phase 1 & Phase 2 & Phase 3 \\
\midrule
\multicolumn{2}{@{}l@{}}{Decision Tree} \\
& R1 & \dots & \dots & \dots \\
& R2 & \dots & \dots & \dots \\
& R3 & \dots & \dots & \dots \\
\addlinespace
\multicolumn{2}{@{}l@{}}{LSTU} \\
& R1 & \dots & \dots & \dots \\
& R2 & \dots & \dots & \dots \\
& R3 & \dots & \dots & \dots \\
\addlinespace
\multicolumn{2}{@{}l@{}}{Average} \\
& R1 & \dots & \dots & \dots \\
& R2 & \dots & \dots & \dots \\
& R3 & \dots & \dots & \dots \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{table}

\end{document}

補遺OPのフォローアップコメント/リクエストに対応するために:上記の表に中央揃えの新しい列を挿入し、新しいヘッダーの内容として「ベースライン」を使用するには、次の変更を行う必要があります。

\begin{tabular}{@{} ll ccc @{}}

\begin{tabular}{@{} ll c ccc @{}}

次に変更

\cmidrule(l){3-5}

\cmidrule(l){4-6}

もちろん、新しい列 3 の内容を、各行に 1 つのセルとして表に挿入することを忘れないでください。

ここに画像の説明を入力してください

\documentclass{article}
\usepackage{array,booktabs}
\usepackage[flushleft]{threeparttable}
\newcommand\ML[1]{\multicolumn{2}{@{}l}{#1}} % handy shortcut macro

\begin{document}

\begin{table}[h]
\centering
\begin{threeparttable}
\caption{Test accuracies achieved by models trained on datasets R1, R2, and~R3}
\begin{tabular}{@{} ll c ccc @{}}
\toprule
\ML{Model} & Baseline & \multicolumn{3}{c@{}}{Training Phases} \\
\cmidrule(l){4-6} 
&&& Phase 1 & Phase 2 & Phase 3 \\
\midrule
\ML{Decision Tree} \\
& R1 & \dots & \dots & \dots & \dots \\
& R2 & \dots & \dots & \dots & \dots \\
& R3 & \dots & \dots & \dots & \dots \\
\addlinespace
\ML{LSTU} \\
& R1 & \dots & \dots & \dots & \dots \\
& R2 & \dots & \dots & \dots & \dots \\
& R3 & \dots & \dots & \dots & \dots \\
\addlinespace
\ML{Average} \\
& R1 & \dots & \dots & \dots & \dots \\
& R2 & \dots & \dots & \dots & \dots \\
& R3 & \dots & \dots & \dots & \dots \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{table}

\end{document}

答え2

名前を繰り返してもそれほど問題ないと思います。私は次のように考えました。データによっては、パッケージSの列を使用しsiunitxたり、テキストを太字 ( \textbf{...}) にしたりする必要があるかもしれません。 ここに画像の説明を入力してください

\documentclass{article}
\usepackage{booktabs,multirow}

\begin{document}
    \begin{tabular}{llllllllll}
        \toprule
        \multirow{2}{*}{Training phases} & \multicolumn{3}{c}{Decision Tree} & \multicolumn{3}{c}{LST M} & \multicolumn{3}{c}{Average} \\ \cmidrule(lr){2-4}\cmidrule(lr){5-7}\cmidrule(lr){8-10}
                                         & R1     & R2     & R3              & R1     & R2     & R3      & R1     & R2     & R3        \\ \midrule
        Training phase 1                 & \ldots & \ldots & \ldots          & \ldots & \ldots & \ldots  & \ldots & \ldots & \ldots    \\
        Training phase 2                 & \ldots & \ldots & \ldots          & \ldots & \ldots & \ldots  & \ldots & \ldots & \ldots    \\
        Training phase 3                 & \ldots & \ldots & \ldots          & \ldots & \ldots & \ldots  & \ldots & \ldots & \ldots    \\ \bottomrule
    \end{tabular}
\end{document}

答え3

テーブルに関する質問は大体答えられると思いますが、Excel2latex が役に立ちます。これは、Excel の TableView で LATEX コードを自動的に編集できる強力な Excel マクロです。非常に良い市場であり、オープンアクセスでオンラインで利用できます。使用に必要なパッケージ (bigstruth、colortbl、multirow など) を確認するには、Ladyte Macro の「Reed me」を参照してください。

このツールを使用すると、Excel でテーブルを作成できます。選択して「convert table to latex」をクリックしてください。 1 秒後に、選択したテーブルの LaTeX コードが生成されます。

答え4

このような表を作成する必要がある場合、私は Excel2latex を使用します。これは、Excel の表の LaTeX コードを自動的に再現する優れた Excel マクロです。これは非常によく機能し、Open Access でオンラインで入手できます。マクロの使用に必要なパッケージ (bigstruth、colortbl、multirow など) を確認するには、マクロの「Read me」を確認する必要があります。

このツールを使用すると、Excel で表を作成できます。次に、表を選択して「表を LaTeX に変換」をクリックします。1 秒で、選択した表の LaTeX コードが生成されます。

関連情報