# The delta (Huber loss function parameter) value of the CvGBTrees

i want to change the delta (Huber loss function parameter) value of CvGBTrees, where / how can i set it? Please help me!

edit retag close merge delete

Sort by ยป oldest newest most voted

you can make an instance of CvGBTreesParams, set your values, and pass that to either the CvGBTrees constructor, or the train method

unfortunately, it's the very last param, so you'll end up with a beast similar to this:

CvGBTreesParams params;
params.loss_function_type = HUBER_LOSS;

CvGBTrees tree( trainData,tflag,responses, Mat(), Mat(), Mat(), Mat(), params ); //lots of default args

more

Thanks for your answers. But if I want to change the value of delta, actually alpha value of the corresponding quintile function for Huber Loss Function, how can I do that?

( 2013-02-22 05:56:59 -0600 )edit

hmm, bear with me, i got no deeper knowledge about gbtrees, but ...

looking at modules/ml/src/gbt.cpp, l 475, it looks like alpha is hardcoded to 0.2, and delta is the outcome of a calculation there.

so, only choice you have is to hack into the src, and recompile the module ;(

( 2013-02-22 06:16:33 -0600 )edit

Perfect!! That works!! Thank you very much!

( 2013-02-22 06:34:30 -0600 )edit

ah, cool ;)

( 2013-02-22 06:41:08 -0600 )edit

But I really don't think they are using the right Quantil Function. Because the original code is "delta = residuals[int(ceil(n*alpha))];", which should be quantil(residuals,alpha). If sigma is the standard deviation, mu the mean of residuals and q the inverse value of normal distribution of alpha, then delta = q * sigma + mean. If alpha = 0.99 then q = 2.326348.

( 2013-02-22 08:26:46 -0600 )edit

shame on me, but that's waaay over my head ;( ( i understand your reasoning above, but total lost at what the code' s doing there..)

so, if you think, there's changes to be made, make an issue here: http://code.opencv.org/projects/opencv/wiki or here (they love pull requests!) https://github.com/itseez/opencv/pulls

( 2013-02-22 09:18:00 -0600 )edit

Official site

GitHub

Wiki

Documentation