Using Classification and subsets
이전 댓글 표시
I'm trying to use the Discriminant Analysis to classify 4 groups from a pool of data, and I've encountered an issue I'm unable to solve.
I've used the following code sample from the 'Classification' page:
lda = fitcdiscr(My_Data,species);
ldaClass = resubPredict(lda);
ldaResubErr = resubLoss(lda); %resubstitution error
cp = cvpartition(species,'KFold',10);
cvlda = crossval(lda,'CVPartition',cp);
ldaCVErr = kfoldLoss(cvlda);
Now, my question is this: is it possible to know what part of the data is being used as the training set, and what part is being used for the classification? To clarify, after I use 'cvpartition' for say, 10 subsets, I can 10x2 groups where for each subset I have a 'training set' and a 'classification set', but I can't seem to find any way to determine which is which.
I hope my question is clear enough. Thank you for your help and time!
답변 (1개)
Sean de Wolski
2016년 1월 4일
Look at the training and test methods of the cvpartition.
cv = cvpartition(100,'KFold',3);
train2 = training(cv,2) % 2nd fold training set is true
카테고리
도움말 센터 및 File Exchange에서 Discriminant Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!