How can I perform k-fold cross validation using an Image category classifier?

조회 수: 6 (최근 30일)
artemoila
artemoila 2016년 1월 29일
댓글: Somaye Ahmadi 2017년 7월 10일
Hello, I am using bag of features to classify between three different classes of histology images. Instead of splitting my data set in training and validation sets I'd like to perform k-fold cross validation because I have few samples. Can anyone help me on how to do this? It'd be great if you posted some code maybe modifying the example ImageCategoryClassificationExample
  댓글 수: 2
Somaye Ahmadi
Somaye Ahmadi 2017년 7월 9일
Hello. I have the same problem. have you solve that? I've found a code but i couldn't get the results. Try it maybe you would solve that. Before using you need to download VLFeat 0.9.20 binary package. It is so easy to add to Matlab path. If you look at code , for example in bovw_surf function used cross validation (5 folds) and also (imageSets = partition(imageSets, minSetCount, 'randomize');) . Good Luck
Somaye Ahmadi
Somaye Ahmadi 2017년 7월 10일
I used help of Matlab the complete code is there and also here . I want to perform cross validation ( 10 fold or LOOcv). i did partition by
imgSets = partition(imgSets, minClassCount, 'randomize')
and then create loop on traingSets and validationSets to have 10 fold-cv ,but i have this error: Undefined function or variable 'trainingSets'.
Error in (line 91)
bag = bagOfFeatures(trainingSets, 'StrongestFeatures', ratioOfStrongFeatures, 'VocabularySize', numberOfClusters);
seems that trainingSets is not appropriate for bagoffeatures..should i make a loop before i use imgSets? Thanks for any help in advance.

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

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by