H2OTypeError:参数应为?integer,得到int64 [3.30.1.1]

问题描述

我正在尝试在H2O XGBoost中简单地使用hyperopt,为此我正在从numpy数组中取出元素作为参数,但是我遇到了H2OTypeError,我不明白为什么{{ ?integer未满足1}}。

为简化示例,H2O XGBoost的调用方式为:

int64

但是以下内容会返回此H2OTypeError:

xgb = H2OXGBoostEstimator(nfolds=5,max_depth=list(range(10,11))[0])

...

xgb = H2OXGBoostEstimator(nfolds=5,max_depth=np.arange(10,11,1)[0])

我现在可以解决该错误,但我不理解。

解决方法

H2O期望使用本机Python int,但是您正在传递numpy int64here进一步说明了差异。

尝试将numpy数组转换为列表max_depth=np.arange(10,11,1).tolist()[0]

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...