How can I predict label of train images by a classifier which was trained using treebagger?

4 views (last 30 days)
Dear All,
I have ten 3D images as train data and one image as test data. It is a classification problem. After creating feature matrix using 10 train images, I trained classifier as follow:
B = TreeBagger(Num_Tree , Feature_A_Norm , Label_A , ...
'Method' , 'classification' , 'OOBPredictorImportance' , ...
'on' , 'MinLeafSize' , Leaf_Size , 'Prior' , 'Uniform' , ...
'MaxNumSplits' , Tree_Depth);
where 'Feature_A_Norm' and 'Label_A' are feature matrix and label of train images, respectively.
Now I need to predict not only label of test image but also train images.
For Test image I used:
[~ , score_Target] = predict(B , Feature_Target_Norm);
where 'Feature_Target_Norm' is feature matrix of test image.
But I am not sure for train images should I use 'predict' function or 'oobPredict' function?I would be really appreciated if you could help me.

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by