Decision Tree Image Classification

5 vues (au cours des 30 derniers jours)
hendra kurnia febriawan
hendra kurnia febriawan le 24 Oct 2018
Réponse apportée : Abhipsa le 3 Sep 2025 à 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

Réponses (1)

Abhipsa
Abhipsa le 3 Sep 2025 à 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!

Community Treasure Hunt

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

Start Hunting!

Translated by