How can I run ten times with randomized data by using imageDatastore ? And how to do cross-validation by imageDatastore?

1 次查看(过去 30 天)

Hi, to test my project I split my data into data of train and data test... this is the code

[ImagesTrain,ImagesTest] = SplitData(ratio_App)

this is the code of function SplitData:

function [dataTrain,dataTest] = SplitData(ratio_App)
unzip(fullfile(matlabroot,'bin','ALLData.zip'));
data = imageDatastore('ALLData',...
    'IncludeSubfolders',true,...
    'LabelSource','foldernames');
[dataTrain,dataTest] = splitEachLabel(data,ratio_App);
dataTrain = shuffle(dataTrain);
end

I obtained the accuracy of my project 94% but when I want to validate it, I try to run my project 10 times by randomized data so I changed the function splitData like that:

function [dataTrain,dataTest] = SplitData(ratio_App)
    unzip(fullfile(matlabroot,'bin','ALLData.zip'));
    data = imageDatastore('ALLData',...
        'IncludeSubfolders',true,...
        'LabelSource','foldernames');
    [dataTrain,dataTest] = splitEachLabel(data,ratio_App,,'randomized');
    dataTrain = shuffle(dataTrain);
  end 

But by this function, I obtained accuracy in each run around 99% and 98% I don't understand why the results are not interpretable Could someone help me or show me where is the problem exactly??

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import and Analysis 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by