MATLAB Answers

How can i do leave-one-out for classification?

조회 수: 28(최근 30일)
Sara Salimi
Sara Salimi 2017년 5월 23일
답변: Matthew Taliaferro 2017년 5월 23일
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:
  1. What data structure is proper for saving this high amount of data? Is is good to save in cell as I have already done?
  2. how to do feature selection on these feature cells? because I do not have all of them is one matrix.
  3. I did these part, but I do not know hoe to proceed for feature selection and later for classification using LOO.
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???
4. How to do leave-one-out cross validation on these cells and send it to the classifier?
Could someone please guide me? Thanks


Matthew Taliaferro
Matthew Taliaferro 2017년 5월 23일
I'm unsure what you are asking, but maybe the functions
cvpartition() and/or crossval()
are what you're looking for?

Community Treasure Hunt

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

Start Hunting!

Translated by