Differences between kernels for fitecoc function?

3 views (last 30 days)
I am building a multi-class classifier using fitecoc and have started playing with different learners and I started with multiclass logistic regression as the most basic one (templateLinear('Learners', 'logistic')). Then, I wanted to try linear SVM, but I am struggling to understand what is the difference between (templateLinear('Learners', 'svm')) and (templateSVM('KernelFunction', 'linear')) as they give different performance accuracy (84 vs. 86%)?

Answers (1)

Shivani
Shivani on 13 Sep 2023
Hi Matej,
Both the "templateLinear(‘Learners’,’svm’) and templateSVM(‘Kernelfunction’,’linear’) are useful in building Support Vector Machine templates for training classifiers with a linear kernel function.
Their prominent difference is that:
  • templateLinear() will typically build an ensemble of linear SVMs and by default will be useful for multiclass models.
  • However, templateSVM() will create a binary classifier by default which must then be combined with the error correcting output codes (ECOC) approach to handle multiple classes.
The potential reason behind the dissimilarity is that the default hyperparameters for both the functions are not the same. Fine tuning these hyperparameters to be the same, can help in providing a more robust comparison between the two.
For more information, please view the official documentation:
Hope this helps!

Community Treasure Hunt

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

Start Hunting!