haifengl / smile

Statistical Machine Intelligence & Learning Engine
https://haifengl.github.io
Other
6.02k stars 1.13k forks source link

rbf kernel? #741

Closed achuinard closed 1 year ago

achuinard commented 1 year ago

I'm using your very useful SVR, porting a project over from Python / scikit-learn, but I notice their default kernel is 'rbf', and I see no mention of an rbf kernel in the Smile source code. Is this available? I'm using linear right now.

haifengl commented 1 year ago

It is called GaussianKernel

achuinard commented 1 year ago

@haifengl I really appreciate you following up here. I am trying to use the GaussianKernel now instead of the Linear one, but the results are terrible.

I have no idea what to set for sigma. My understanding is that scikit-learn calculates a gamma value as 1 / num_features.

What would I set the sigma to in Java?

haifengl commented 1 year ago

gamma = 1 / (2 * sigma * sigma)