ja-thomas / autoxgboost

autoxgboost - Automatic tuning and fitting of xgboost
Other
120 stars 19 forks source link

why use negative values for lambda,... #61

Closed caprone closed 5 years ago

caprone commented 5 years ago

HI why use negative values for lambda, gamma and alpha ????

caprone commented 5 years ago

a ok, i cheked source; autoxgbparset = makeParamSet( makeNumericParam("eta", lower = 0.01, upper = 0.2), makeNumericParam("gamma", lower = -7, upper = 6, trafo = function(x) 2^x), makeIntegerParam("max_depth", lower = 3, upper = 20), makeNumericParam("colsample_bytree", lower = 0.5, upper = 1), makeNumericParam("colsample_bylevel", lower = 0.5, upper = 1), makeNumericParam("lambda", lower = -10, upper = 10, trafo = function(x) 2^x), makeNumericParam("alpha", lower = -10, upper = 10, trafo = function(x) 2^x), makeNumericParam("subsample", lower = 0.5, upper = 1) ) but, when i run the cntrl, seems that 'trafo' doesn't work, then it returned me negative values...for gamma, lambda e alpha..

EDIT:

ISSUE IS HERE:

res$optim.result$x

it return correct 'recommended parameters' but for lambda, gamma and alpha; for these return 'pre' trafo values, then return also negative values

ja-thomas commented 5 years ago

Hi,

these values are tuned on log-scale to make the tuning more efficient. OptPath entries always use the values as seen by the optimizer, hence the untransformed values. The printer shows the correct transformed values and they are also saved in the final.learner object if you want to train the learner on new data (If you want to train it on the same data you can just use the build.final.model argument).

If you directly need the transformed values you can easily extract them from the final.learner with getHyperPars(res$final.learner).

I don't plan to change the internal representation of the optim.result, since it is done created by mlrMBO and not directly by autoxgboost.

Are the untransformed values returned anywhere else by autoxgboost, except for accessig them by res$optim.result$x?

caprone commented 5 years ago

a OK perfect, thanks;

@ja-thomas "Are the untransformed values returned anywhere else by autoxgboost, except for accessig them by res$optim.result$x?"

No, seems not

ps. Great work, very useful

liuyanguu commented 5 years ago

Very helpful. I spent quite some time to find the recommended parameters... Thanks for the discussion.

ja-thomas commented 5 years ago

cool :)