Skip to main content
added 1 character in body
Source Link
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 thethen use

input[[train]] 
input[[validation]]
input[[test]]

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 the use

input[[train]] 
input[[validation]]
input[[test]]

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]]
Source Link
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 the use

input[[train]] 
input[[validation]]
input[[test]]