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