我有一张用于机器学习消融研究的表格,我希望单元格颜色根据单元格中包含的值逐行变化。情况类似于以下内容:
\documentclass{article}
%opening
\title{}
\author{}
\usepackage[utf8]{inputenc} % allow utf-8 input
\usepackage[T1]{fontenc} % use 8-bit T1 fonts
\usepackage{booktabs} % professional-quality tables
\usepackage{nicefrac} % compact symbols for 1/2, etc.
\usepackage{doi}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{multicol}
\usepackage{multirow}
\begin{document}
\begin{table*}[h]
\setlength{\tabcolsep}{3.5pt}
\renewcommand*{\arraystretch}{1.6}
\caption{Ablation study.}
\label{table:ablation}
\begin{center}
\begin{tabular}{ l | p{0.8cm}| c c c c c c}
\toprule
\vspace{-6pt} % Adjust the value to reduce space, the higher the lower the spacing between the first two rows
Dataset & & Model1 & Model2 & Model3 & Model4\\
& & & & & \\
\midrule
Dataset1 & M1 & $134.49$ & $145.05_{\pm 13.83}$ & $129.59_{\pm 4.98}$ & $\bm{128.7.06}_{\pm 11.01}$\\
Dataset2 & M1 & $ 1.76_{\pm 0.00}$ & $1.72_{\pm 0.05}$ & $1.69_{\pm 0.05}$ & $\bm{1.71_{\pm 0.01}}$\\
\bottomrule
\end{tabular}
\end{center}
\end{table*}
\end{document}
基本上我想要一个表格单元格的热图,其颜色根据单元格值合理变化每一行,因为度量标准 (M1) 的尺度根据所考虑的每个数据集而不同。我该如何实现这一点?