Skip to main content
2 of 2
added 1 character in body
molekyla777
  • 2.9k
  • 1
  • 15
  • 28

Other elegant implementation

rs = RandomSample[Range[Length[input]]];
train = rs[[1 ;; Round[Length[input]*0.7]]];
validation= rs[[Round[Length[input]*0.7] + 1 ;;Round[Length[input]*0.9]]];
test = rs[[Round[Length[input]*.9] + 1 ;;]];

and then use

input[[train]] 
input[[validation]]
input[[test]]
molekyla777
  • 2.9k
  • 1
  • 15
  • 28