I've got a very simple problem, but not so trivial. I need to split a dataset (input and output data) in three part randomly: training set 70%, validation set 20% and is test set 10%. First of all this splitting have to be random, but reproducible, so I set SeedRandom. So I produce this simple code to split in two part (70% and 30%), but I've some problem to split in three part (70%, 20% and 10%). input is a matrix and oputput a list of numbers, for example:
input= {{0.688217, 0.362944, 0.468409, 0.133651}, {0.746246, 0.365313,
0.661147, 0.124928}, {0.688217, 0.362944, 0.892652,
0.133651}, {0.736027, 0.327411, 0.429482, 0.138367}, {0.765381,
0.390355, 0.81139, 0.148402}, {0.869656, 0.485533, 0.851523,
0.200265}, {0.757873, 0.412183, 0.573253, 0.174008}, {0.64025,
0.323266, 0.477443, 0.1111}, {0.648592, 0.327327, 0.614614,
0.115339}, {0.993743, 0.701184, 0.71341, 0.290435}, {0.763712,
0.542893, 0.685418, 0.22885}};
output={0.707695, 0.641002, 0.576708, 0.514697, 0.454514, 0.395702,
0.338031, 0.280931, 0.224174,0.1211,0.23234};
SeedRandom[1234];
index = RandomSample[Range[Length[input]], IntegerPart[Length[input]*0.3]];
indexp = Partition[index, 1];
inputv = {};
outputv = {};
(*Validation TEST*)
inputv = Table[Append[inputv, input[[i]]], {i, index}];
outputv = Table[Append[outputv, output[[i]]], {i, index}];
(*Test TEST*)
inputt = Delete[input, indexp];
outputt = Delete[output, indexp];
inputv = Flatten[inputv, 1];
outputv = Flatten[outputv];
Could you help me? Thanks...