Hello,
I'm trying to run a GBM with monotonicity on some of the predictors, and with the target distribution of Gamma/Poisson. According to the
documentation, it can be done by specifying the Tweedie distribution and to set the Tweedie power to 1 (Poisson) or 2 (Gamma). However, when I do that I get an error: _tweedie_power: Tweedie power must be between 1 and 2 (exclusive). Could you please clarify this issue?
I'm using Python 3.8 and h2o version 3.32.1.3 (but also got the same issue with 3.36.0.1).
below is code to reproduce the issue:
import h2o
from h2o.estimators import H2OXGBoostEstimator
from h2o.estimators import H2OGradientBoostingEstimator
import numpy as np
import pandas as pd
from sklearn.datasets import fetch_california_housing
cal_housing = fetch_california_housing()
h2o.init()
data = h2o.H2OFrame(cal_housing.data, column_names=cal_housing.feature_names)
data["target"] = h2o.H2OFrame(cal_housing.target)
train, test = data.split_frame([0.6], seed=123)
feature_names = ['MedInc', 'AveOccup', 'HouseAge']
monotone_constraints = {"MedInc": 1, "AveOccup": -1, "HouseAge": 1}
gbm_mono = H2OGradientBoostingEstimator(monotone_constraints=monotone_constraints,
distribution = 'tweedie', tweedie_power=2)
gbm_mono.train(x=feature_names, y="target", training_frame=train, validation_frame=test)
Thanks,
Nimrod