More than one prediction using TreeBagger?

8 views (last 30 days)
andrea
andrea on 29 Sep 2012
Hi, I'm using TreeBagger to predict an audio genre of a track.
here there's some code I've used for this aim: nTrees = 500; forest = TreeBagger(nTrees,FeaturesNames,datafile2.Genre,'oobvarimp','on','oobpred','on'); [oobP, oobS] = oobPredict(forest); [conf, classorder] = confusionmat(datafile2.Genre,oobP);
[... ... ] after the computation of the features: arrayT = arrayFeatures';
prediction = char(predict(forest,arrayT));
% write my prediction on a file
fwrite(predictionFile,num2str(prediction));
fprintf(predictionFile,'\n');
so there's one prediction for each file.
I'd like to know, as my title says, if there's the possibility of more than one prediction per track. For example I can use an audio track with speech and music consecutive, and I'd like an answer with more than one genre, based on the statistical of the treeBagger.
is there this possibility?
thanks

Answers (0)

Community Treasure Hunt

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

Start Hunting!