I don't know how to input it in LyX, but this LaTeX code should do.
\documentclass{article}
\begin{document}
\begin{tabular}{ *{7}{r} | c@{}l }
\multicolumn{1}{c}{a} &
\multicolumn{1}{c}{b} &
\multicolumn{1}{c}{c} &
\multicolumn{1}{c}{d} &
\multicolumn{1}{c}{e} &
\multicolumn{1}{c}{f} &
\multicolumn{1}{c}{g} &
\multicolumn{2}{l}{$\leftarrow$ classified as} \\[\jot]
1 & 5 & 10 & 8 & 4 & 2 & 0 & a & ${}=3$ \\
3 & 39 & 100 & 66 & 6 & 2 & 0 & b & ${}=4$ \\
4 & 74 &1385 & 596 & 69 & 10 & 0 & c & ${}=5$ \\
10 & 47 & 631 &1763 & 346 & 39 & 0 & d & ${}=6$ \\
1 & 11 & 80 & 417 & 533 & 37 & 0 & e & ${}=7$ \\
1 & 0 & 11 & 50 & 62 & 69 & 0 & f & ${}=8$ \\
0 & 0 & 0 & 1 & 4 & 0 & 0 & g & ${}=9$ \\
\end{tabular}
\end{document}

If you want all columns with equal width, then siunitx
seems to provide the easiest way.
\documentclass{article}
\usepackage{siunitx}
\begin{document}
\begin{tabular}{ *{7}{S[table-format=4.0]} | c@{}l }
\multicolumn{1}{c}{a} &
\multicolumn{1}{c}{b} &
\multicolumn{1}{c}{c} &
\multicolumn{1}{c}{d} &
\multicolumn{1}{c}{e} &
\multicolumn{1}{c}{f} &
\multicolumn{1}{c}{g} &
\multicolumn{2}{l}{$\leftarrow$ classified as} \\[\jot]
1 & 5 & 10 & 8 & 4 & 2 & 0 & a & ${}=3$ \\
3 & 39 & 100 & 66 & 6 & 2 & 0 & b & ${}=4$ \\
4 & 74 &1385 & 596 & 69 & 10 & 0 & c & ${}=5$ \\
10 & 47 & 631 &1763 & 346 & 39 & 0 & d & ${}=6$ \\
1 & 11 & 80 & 417 & 533 & 37 & 0 & e & ${}=7$ \\
1 & 0 & 11 & 50 & 62 & 69 & 0 & f & ${}=8$ \\
0 & 0 & 0 & 1 & 4 & 0 & 0 & g & ${}=9$ \\
\end{tabular}
\end{document}
