function [trainingdataset,validationdataset,testingdataset,trainingdata,validationdata,testdata,knowledgeRuleBase] = fuzzyfication_Cross_Validation(totalmatrix,kfolds,partition_method) |
CVO = cvpartition(totalmatrix(:,end-1,end); |
for i = 1: CVO.NumTestSets |
trIndx = CVO.training(i); |
teIndx = CVO.test(i); |
trainingdataset = []; |
trainingdata = []; |
validationdataset = []; |
validationdata = []; |
testingdataset = []; |
testingdata = []; |
for j = 1: number of variables |
trainingdataset(:,:,j) = totalmatrix(trIndx,:,j); |
trainingdata (:,:,j) = trainingdataset(:,1,j); |
validationdataset(:,:,j) = totalmatrices(teIndx,:,j); |
validationdata(:,:,j) = validationdataset(:,1,j); |
end |
reshape trainingdata; |
reshape validationdata; |
[knowledgeRuleBase] = knowledgeRB(i,trainingdata, validationdata,testingdata,numvarinputs); |
end |
end |