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

6 visualizzazioni (ultimi 30 giorni)
Sara Salimi
Sara Salimi il 23 Mag 2017
Risposto: Matthew Taliaferro il 23 Mag 2017
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:
  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.
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

Risposte (1)

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

Categorie

Scopri di più su Statistics and Machine Learning Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by