2

Could you help me draw this table:

Mut

This is a MWE, it does not look similar at all but it is a starting point. I would do \begin{tabular}{*{11}{c}}

\documentclass{article}
\usepackage{multirow}
\usepackage{amsmath}
\usepackage{setspace}
\usepackage{booktabs} % provides \toprule, \bottomrule,\midrule, \cmidrule
\begin{document}

\begin{table}
        \small

        \begin{tabular}{*{8}{c}}
            \toprule
            &  &  &   & \multicolumn{2}{c}{\textbf{ML}}
            & \multicolumn{2}{c}{\textbf{ML}}  \\
            \cmidrule(lr){5-6} \cmidrule(lr){7-8}
            $\lambda$   & $\gamma$  & $n$& $L$ &  RMSE    &  MAE      & RMSE  & MAE \\
            \midrule
            0.01        & 0.006  & 30 & 1       & 0.9133    &    \textbf{0.9401}    &       &   \\
            0.01        & 0.002  & 50 & 2      &           & &0.8973       &  \textbf{0.9080} \\
            \bottomrule
        \end{tabular}


    \end{table}

\end{document}


\documentclass{article}
\usepackage{multirow}
\usepackage{amsmath}
\usepackage{setspace}
\usepackage{booktabs} % provides \toprule, \bottomrule,\midrule, \cmidrule
\begin{document}

\begin{table}
        \small

        \begin{tabular}{*{8}{c}}
            \toprule
            &  &  &   & \multicolumn{2}{c}{\textbf{ML}}
            & \multicolumn{2}{c}{\textbf{ML}}  \\
            \cmidrule(lr){5-6} \cmidrule(lr){7-8}
            $\lambda$   & $\gamma$  & $n$& $L$ &  RMSE    &  MAE      & RMSE  & MAE \\
            \midrule
            0.01        & 0.006  & 30 & 1       & 0.9133    &    \textbf{0.9401}    &       &   \\
            0.01        & 0.002  & 50 & 2      &           & &0.8973       &  \textbf{0.9080} \\
            \bottomrule
        \end{tabular}


    \end{table}

\end{document}

enter image description here

Second mwe:

\documentclass{article}
\usepackage{multirow}

\begin{document}

\begin{table}[htbp]
\centering
\begin{tabular}{|c|c|c|c|p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}|}
\hline
A & B & C & D & \multicolumn{7}{|c|}{F}  \\ \hline
\multirow{ 2}{*}{1} & 0 & 6 & 230 & 35 & 40 & 55 & 25 & 40 & 35 & \\
& 1 & 5 & 195 & 25 & 50 & 35 & 40 & 45 &  &  \\ \hline
\end{tabular}
\caption{A test caption}
\label{table2}
\end{table}

\end{document}
3

The following is a recreation of that table. It differs in some of the columns, but, imho, this gives better results (maybe the second "Details" column could be aligned in a different way though).

\documentclass[border=3.14]{standalone}

\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{array}
\usepackage{multirow}

\newcolumntype\math[1]{>{$}#1<{$}}

\begin{document}
\begin{tabular}
  {
    ll \math{r}@{${}={}$} S[table-format=4]
    S[table-format=1.2] *4{S[table-format=2]} *2{S[table-format=.3]}
    S[table-format=2]@{\,}l
  }
  \toprule
  Algorithm & Details & \multicolumn{2}{c}{}
    & {RMSE} & {Cov} & {Prec} & {Rec} & {F}
    & {Surp\textsuperscript{max}}
    & {Surp\textsuperscript{avg}}
    & \multicolumn{2}{c}{Time}
  \\
  \midrule
  \multirow{4}{*}{Parall} & \multirow{2}{*}{Sample} & n&100
    & 1.18 & 57 & 95 & 68 & 79 & .419 & .166
    & 10&m
  \\
  & & n&1000
    & 1.04 & 23 & 95 & 27 & 42 & .418 & .168
    & 1&h
  \\
  & \multirow{2}{*}{$k$-NN} & k&20
    & 1.00 & 31 & 97 & 38 & 54 & .421 & .176
    & 6&h
  \\
  & & k&30
    & 0.99 & 25 & 96 & 31 & 47 & .422 & .177
    & 19&h
  \\
  \cmidrule{1-4}
  & MSD & k&40
    & 0.98 & 23 & 96 & 28 & 43 & .423 & .175
    & 30&s
  \\
  $k$-NN & Cos & k&40
    & 1.02 & 21 & 96 & 26 & 41 & .426 & .180
    & 30&s
  \\
  & Pears & k&40
    & 1.01 & 25 & 95 & 30 & 46 & .425 & .170
    & 30&s
  \\
  \cmidrule{1-4}
  PMF & & f&100
    & 0.95 & 38 & 99 & 47 & 64 & .422 & .178
    & 45&s
  \\
  Mean & & \multicolumn{2}{c}{}
    & 1.13 & \multicolumn{6}{c}{}
    & 1&s
  \\
  Random & & \multicolumn{2}{c}{}
    & 1.52 & 81 & 86 & 89 & 88 & .432 & .155
    & 1&s
  \\
  \bottomrule
\end{tabular}
\end{document}

enter image description here

3
  • It looks sharp. Where does it differ?
    – NaveganTeX
    Oct 28 '19 at 0:44
  • 1
    @NaveganTeX In the second "Detail" column the numbers are right aligned (or better use an S column). The two "Surp" columns have leading zeros, the "Time" column adds a bit of space between numbers and units. All number columns use S type columns. Some of the columns are actually two columns (2nd "Details" and "Time" column), to get automatic spacing and the alignments. In all number columns the column heads are centred instead of left aligned to the numbers.
    – Skillmon
    Oct 28 '19 at 0:46
  • Thank you very much for such detailed explanation!
    – NaveganTeX
    Oct 28 '19 at 1:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.