How can i do leave-one-out for classification?
4 views (last 30 days)
Show older comments
Hi
I have 110 stack of images (110 different patients), and I have extracted each patients features which is a matrix (2,400,000 x 135) and the ground truth (labels) for each (2400000 X 1). The task that I am doing is classifying each pixel. I have saved these images in two cells (here i have brought only three patients for simplicity):
featCell=1x3 cell (2,400,000 x 135 inside each cell)
lbcell=1x3 cell (2400000 X 1 inside each cell)
I want to do feature selection and then classification with knn classifier. Beside I want to apply leave-one-out cross validation (take one patient out as test and the rest two patients as train). I do not know how to do leave-one-out for these cells? If I save in matrix, it is not possible since I have millions of rows. My questions are as follows:
- What data structure is proper for saving this high amount of data? Is is good to save in cell as I have already done?
- how to do feature selection on these feature cells? because I do not have all of them is one matrix.
- I did these part, but I do not know hoe to proceed for feature selection and later for classification using LOO.
N=length(featCell);
M=1;
for i=1:length(featCell)
[Train, Test] = crossvalind('LeaveMOut', N, M);
Train_ind = find(Train); % finding the indices of those cells for training
Test_ind=find(Test); % finding the indices of those cells for validation
%%%I do not what to do here???
end
4. How to do leave-one-out cross validation on these cells and send it to the classifier?
Could someone please guide me? Thanks
0 Comments
Answers (1)
Matthew Taliaferro
on 23 May 2017
I'm unsure what you are asking, but maybe the functions
cvpartition() and/or crossval()
are what you're looking for?
0 Comments
See Also
Categories
Find more on Image Data Workflows in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!