This is the code:
setDir = fullfile(toolboxdir('vision'),'visiondata','imageSets');imds = imageDatastore('C:\Users\JIARA\Documents\MainGUI\Eye Images\*.jpg');[trainingSet,testSet] = splitEachLabel(imds,0.3,'randomize');bag = bagOfFeatures(trainingSet);categoryClassifier = trainImageCategoryClassifier(trainingSet,bag);confMatrix = evaluate(categoryClassifier,testSet);
Best Answer