Decision Tree Image Classification

5 次查看(过去 30 天)
hendra kurnia febriawan
回答: Abhipsa 2025-9-3,4:06
Hi All,
Currently, I am doing image classification using SVM and DT with the same training data and the same test image. The setting of SVM and DT used the default. There are four classes that I used (A, B, C, D). While in SVM training using Mdl = fitcecoc(trainset,class) it can classify all class, but in DT training using SVModelTree = fitctree(trainset,class) there are only three class A, C, D in the result and seems that the class B is classified as class C. Anycone can help me what causes of that? Thank you in advance.
Hend

回答(1 个)

Abhipsa
Abhipsa 2025-9-3,4:06
I understand your concern regarding Decision Tree (fitctree) model not predicting one of the classes (class B) while SVM (fitcecoc) model is correctly classifying all four classes (A, B, C, D).
This almost always comes down to class imbalance and a simple tree. With default settings, a single tree (fitctree) will happily create leaves that never predict a minority class if the splits don’t isolate it cleanly. An SVM (fitcecoc) draws global boundaries and often still carves out some region for that small class, so you see B with SVM but not with the tree.
One of the possible reasons would be that the dataset could have been imbalanced i.e. class B is having a lesser number of samples. To mitigate this issue, bagging methodologies like "random forest" could be used.
You can refer to the below MATLAB documentations for more deatils:
Hope this helps!

类别

Help CenterFile Exchange 中查找有关 Classification 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by