Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[tikz,border=7pt]{standalone}
- use tikz library{matrix, arrows.meta} % added arrows.meta
- begin{document}
- begin{tikzpicture}
- matrix (M) [
- matrix of nodes,
- nodes={
- minimum height = 7mm,
- minimum width = 2cm,
- outer sep=0,
- anchor=center,
- draw,fill=blue!20 % <-added
- },
- column 1/.style={
- nodes={draw=none,fill=none}, % <-- added fill=none
- minimum width = 4cm
- },
- row sep=5mm, column sep=-pgflinewidth,
- nodes in empty cells,
- e/.style={fill=black!50}
- ]
- {
- 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-7.north east); % changed 5 to 7
- draw (M-1-2.north west) ++(0,2mm) coordinate (LT) edge[|<->|, >= latex] node[above]{Test} (LT-|M-1-2.north east);
- % dots
- node [below=3pt] at (M-3-5.south east) {$cdots$};
- % fold labels and arrows
- foreach [
- count=row,
- evaluate={col=ifthenelse(row==4, % if fourth row
- int(row+3), % use seventh column
- int(row+1)) % else use column row+1
- }
- ] txt in {1,2,3,k}
- {
- node [below] at (M-row-col.south) {Fold-txt};
- draw [black!30,line width=1mm,-Triangle] (M-row-7.east) ++(2mm,0) -- ++(7mm,0) node[black, right] {$E_{txt}$};
- }
- end{tikzpicture}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement