SVM KernelFunction and KernelScale. What is the difference?
Ältere Kommentare anzeigen
When using Support Vector Machines in the Classification Learner, what is the diffence between the KernelFunction (gaussian, linear, quadratic or cubic) and the KernelScale (which could be any number)?
Is a SVM with a linear KernelFunction and Kernelscale of 2 the same as a SVM wth a quadratic KernelFunction and a KernelScale of 1?
Thanks in advance.
Antworten (1)
Pratyush Roy
am 5 Feb. 2021
1 Stimme
Hi Dylan,
The KernelScale is a scaling parameter which is used to scale the data before evaluation of the appropriate Gram matrix.
- In case one specifies the parameter to be 'auto', the software selects an appropriate scale factor using a heuristic procedure. This heuristic procedure uses subsampling, so estimates can vary from one call to another. Therefore, to reproduce results, set a random number seed using rng before training.
- If one specifies KernelScale and a custom kernel function, for example, 'KernelFunction', 'kernel', then the software throws an error. Then scaling must be applied within kernel.
The KernelFunction is the function used to compute the elements of Gram Matrix G after scaling has been applied using the KernelScale parameter.
The linear kernel function can be defined as:
Scaling the predictor variables by a factor of, say, s gives us the Gram matrix

This is not same as a quadratic kernel function with scaling factor 1 with the following form:

Hope this helps!
Kategorien
Mehr zu Statistics and Machine Learning Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!