Xgboost, exposure bias?

I am simulating a bid frequency (Poisson range) in R. I am using gbm and xgboost , but does xgboost seem to have no offset parameter to take into account the exposure?

In a gbm could be considered as follows:

 gbm.fit(x = train,y = target, n.trees = 100,distribution = "poisson", offset = log(exposure)) 

How to achieve the same result with `xgboost?

PS: I cannot use exposure as a predictor since a new obs is created every time a requirement is observed.

+4
source share
2 answers

Once you have created your xgboost matrix, you can set the offset using setinfo and the base_margin attribute, for example:

 setinfo(xgtrain, "base_margin", log(d$exposure)) 

You can see the full example from a similar question that I asked here: XGBoost - Poisson distribution with variable exposure / offset

+2
source

Normalize your score with exposure and use exposure as weight. See more details.

0
source

Source: https://habr.com/ru/post/1243971/


All Articles