Which kernel is used in fitcecoc, a multiclass mode for support vector machines

8 visualizaciones (últimos 30 días)
i have read the detailed description available here https://it.mathworks.com/help/stats/fitcecoc.html#bue3ojr-2 again and again but i can't seem to understand which kernel is being used in fitcecoc SVM classifier by default?
I understand that fitcecoc is a binary classifer that is it uses K(K – 1)/2 binary support vector machine (SVM) models using the one-versus-one coding design but i can't understand which kernel is used by default?

Respuestas (1)

Darshak
Darshak el 23 de Jun. de 2025
I have noticed that understanding the default behavior of functions like “fitcecoc” can sometimes be a bit unclear, especially when it comes to settings like kernel choice in SVMs. The following points may help clarify about the solution:
  • The “fitcecoc” function is a multiclass classification model that works by internally training multiple binary classifiers. By default, it uses a one-vs-one (OVO) coding design, which results in K(K–1)/2 binary models for K classes.
  • If no learner is specified using the 'Learners' name-value pair, “fitcecoc” internally relies on the default settings of the “templateSVM” function. This template governs how each binary SVM is trained.
  • According to the documentation for “templateSVM”, the default kernel used is "linear"
By default, each of the binary learners inside “Mdl.BinaryLearners” will be an SVM using a linear kernel.
  • To confirm which kernel function is being used, the kernel of any of the binary models can be inspected after training:
Mdl.BinaryLearners{1}.KernelParameters.Function
  • If the intention is to use a different kernel (such as "gaussian" or "polynomial"), it is better to explicitly define a learner using “templateSVM” and pass it to “fitcecoc”. That makes the configuration transparent and controllable.
The following documentation links can be referred to for a better understanding:
It is generally a good idea to always check or set the learner explicitly when kernel choice is critical to your application, especially if performance is sensitive to non-linearity in the data.

Community Treasure Hunt

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

Start Hunting!

Translated by