3

I have been accustomed to use the base margin parameter in standard xgboost to allow for offset, starting (transformed) prediction (see this SO question SO xgboost exposure question. I wonder if it were possible to perform the same in the h2o implementation of xgboost. In particular I see an offset parameter, but I wonder wether it has been really truly implemented.

Giorgio Spedicato
  • 2,413
  • 3
  • 31
  • 45
  • 1
    It is not supported at the moment. When used you should see an error ("Offset is not supported for XGBoost") – Michal Kurka Mar 13 '18 at 23:40
  • @Michal Kurka (H2O): yes, it is, at least in xgboost, only called otherwise: `setinfo(xgbMatrix, "base_margin", log(exposure))`; it has always been that way: https://github.com/dmlc/xgboost/issues/681#issuecomment-297862691. Only H2O did not support it , favoring built-in GBM's (with offset). Has H2O fixed this by now? – mirekphd Jul 31 '21 at 09:17

1 Answers1

2

Good question -- this is not documented in the parameter description (we use a common definition of offset_column among all algos and there's no note about how its not working in XGBoost). It is not functional and you should get an error if you try to supply it.

R example:

library(h2o)
h2o.init()

fit <- h2o.xgboost(x = 1:3, y = "Species", offset_column = "Petal.Width",
                   training_frame = as.h2o(iris))

Gives error:

Error: water.exceptions.H2OModelBuilderIllegalArgumentException: Illegal argument(s) for XGBoost model: XGBoost_model_R_1520909592004_2.  Details: ERRR on field: _offset_column: Offset is not supported for XGBoost.
Erin LeDell
  • 8,704
  • 1
  • 19
  • 35