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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!