
function [trainingSet, validationSet, testSet] = splitDataNN(data, trainingSize, validationSize, testSize)

[classes,map] = mymapping(data);

trainingSet = [];
validationSet = [];
testSet = [];

for i=1:length(classes(:,1))
   rows = cell2mat(map(i,1));
   
   rows = rows(randperm(length(rows)));
   trsize = floor(length(rows)*trainingSize);
   vsize = floor(length(rows)*validationSize);
   testsize = floor(length(rows)*testeSize);
   
   trainingSet   = [trainingSet   rows(1:trsize) ];
   validationSet = [validationSet rows(trsize+1, trsize+vsize) ];
   testSet       = [testSet       rows(trsize+vsize+1, end) ];
end

%{
for i=1:length(division(:,1))
    a = cell2mat(division(i,2));
    division(i,2) = {a(randperm(length(a)))};
    
    a = cell2mat(division(i,2));
    split = floor(length(a)*partitioning);
    
    trainingSet = [trainingSet a(1:split)];
    testSet = [testSet a(split+1:end)];

end
%}