I want to draw a diagram representing K-fold cross validation like this
this is a minimal:
\documentclass[tikz,border=7pt]{standalone}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix (M) [matrix of nodes,
nodes={minimum height = 7mm, minimum width = 2cm, outer sep=0, anchor=center, draw},
column 1/.style={nodes={draw=none}, minimum width = 4cm},
row sep=1mm, column sep=-\pgflinewidth, nodes in empty cells,
e/.style={fill=black!90}
]
{
1st Iter & |[e]| & & & \\
2nd Iter & & |[e]| & & \\
3rd Iter & & & |[e]| & \\
kth Iter& & & & |[e]| \\
};
\draw (M-1-3.north west) ++(0,2mm) coordinate (LT) edge[|<->|, >= latex] node[above]{Train} (LT-|M-1-5.north east);
\draw (M-1-2.north west) ++(0,2mm) coordinate (LT) edge[|<->|, >= latex] node[above]{Test} (LT-|M-1-2.north east);
\end{tikzpicture}
\end{document}
How can I add the details including cell colors and Fold caption like attached picture?