Combine multiple datastores in for loop for Leave one out cross validation

조회 수: 2 (최근 30일)
Mudit Paliwal
Mudit Paliwal 2020년 12월 5일
댓글: Mudit Paliwal 2020년 12월 10일
I have 30 imagedatastores stored in a cell arrays bigImgDS{30,1}.
Now I want select one datastore in cell array as test and combine all other as train in one iteration of loop. But it doesnt allow me to do that
N = numel(bigImgDS)
for i =1:N
test = Big_ImgDs{i,1};
train = Big_ImgDs{[1:end ~=i],1}
end

답변 (1개)

Anmol Dhiman
Anmol Dhiman 2020년 12월 10일
Hi Mudit,
Use the following code for looping in the cell array
for i =1:N
test = Big_ImgDs{i};
train = Big_ImgDs;
train(i)=[];
end
Regards,
Anmol Dhiman
  댓글 수: 3
Mudit Paliwal
Mudit Paliwal 2020년 12월 10일
I tried that out Anmol. But Split ImageDatastore labels by proportions - MATLAB splitEachLabel (mathworks.com) doesnt work on combine. Thats the problem the combine datastore doesnt behave the same way as a Image datastore

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Preprocessing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by