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.