我在Python中尝试使用H2OAutoML创建回归模型,但找不到如何传递’weights_column’参数。
我尝试了以下两种方法:
# 创建AutoML模型.aml = H2OAutoML( seed=0, max_runtime_secs = None, include_algos=['GBM', 'DRF'], stopping_metric='RMSE', exploitation_ratio=0.1, weights_column='weight' )
这段代码引发了TypeError
错误:TypeError: H2OAutoML got an unexpected keyword argument 'weights_column'
# 创建AutoML模型.aml = H2OAutoML( seed=0, max_runtime_secs = None, include_algos=['GBM', 'DRF'], stopping_metric='RMSE', exploitation_ratio=0.1, algo_parameters={'weights_column': 'weight'} )
而这段代码在训练步骤中引发了H2oResponseError
错误:
H2OResponseError: Server error water.exceptions.H2OIllegalValueException:Error: Illegal value for field: algo_parameters: weights_column
有人能帮助我使用这个参数吗?谢谢
回答:
您应该在.train()
方法中调用weights_column
参数。例如:
aml.train(x=x, y=y, training_frame=train, weights_column='weight')