Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. documentclass[tikz,border=7pt]{standalone}
  2. use tikz library{matrix, arrows.meta} % added arrows.meta
  3. begin{document}
  4. begin{tikzpicture}
  5. matrix (M) [
  6. matrix of nodes,
  7. nodes={
  8. minimum height = 7mm,
  9. minimum width = 2cm,
  10. outer sep=0,
  11. anchor=center,
  12. draw,fill=blue!20 % <-added
  13. },
  14. column 1/.style={
  15. nodes={draw=none,fill=none}, % <-- added fill=none
  16. minimum width = 4cm
  17. },
  18. row sep=5mm, column sep=-pgflinewidth,
  19. nodes in empty cells,
  20. e/.style={fill=black!50}
  21. ]
  22. {
  23. 1st Iter & |[e]| & & & & & \
  24. 2nd Iter & & |[e]| & & & & \
  25. 3rd Iter & & & |[e]| & & & \
  26. kth Iter & & & & & & |[e]| \
  27. };
  28. 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
  29. draw (M-1-2.north west) ++(0,2mm) coordinate (LT) edge[|<->|, >= latex] node[above]{Test} (LT-|M-1-2.north east);
  30.  
  31. % dots
  32. node [below=3pt] at (M-3-5.south east) {$cdots$};
  33.  
  34. % fold labels and arrows
  35. foreach [
  36. count=row,
  37. evaluate={col=ifthenelse(row==4, % if fourth row
  38. int(row+3), % use seventh column
  39. int(row+1)) % else use column row+1
  40. }
  41. ] txt in {1,2,3,k}
  42. {
  43. node [below] at (M-row-col.south) {Fold-txt};
  44. draw [black!30,line width=1mm,-Triangle] (M-row-7.east) ++(2mm,0) -- ++(7mm,0) node[black, right] {$E_{txt}$};
  45. }
  46. end{tikzpicture}
  47. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement