What is the right formula for the RBF 'KernelScale' of fitcsvm?

RBF kernel function is defined as exp(-1/(2*sigma^2) ....
The option 'KernelScale' of the Matlab function fitcsvm, does it refer to sigma, sigma^2, 2*sigma^2, or sqrt(2)*sigma ?

 Respuesta aceptada

Ayush Anand
Ayush Anand el 12 de En. de 2024
Editada: Ayush Anand el 12 de En. de 2024
Hi,
The RBF kernel function is defined as :
The "KernelScale" option in the function "fitcsvm" refers to σ (sigma) in the above equation.
You can read more through the definition of parameters of the "fitcsvm" function here:
Hope this helps!

1 comentario

Leon
Leon el 7 de Abr. de 2025
Editada: Leon el 7 de Abr. de 2025
KernelScale is not quite the same as sigma: KernelScale = sqrt(2) * sigma, see my answer below.

Iniciar sesión para comentar.

Más respuestas (1)

Leon
Leon el 7 de Abr. de 2025
Editada: Leon el 7 de Abr. de 2025
The RBF (Gaussian) kernel can be defined with either gamma or sigma:
or
where sigma is the standard deviation of the Gaussian distribution.
According to the fitcsvm documentation, instead of using sigma or gamma, the prediction data is simply divided by KernelScale before training, and
Therefore,
KernelScale = 1/sqrt(gamma)
as clarified by MathWorks staff here:
And:
KernelScale = sqrt(2) * sigma

Categorías

Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 4 de Mayo de 2018

Editada:

el 7 de Abr. de 2025

Community Treasure Hunt

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

Start Hunting!

Translated by