如何在 H2OAutoML 中设置 weights_column?

How to set weights_column in H2OAutoML?

我试图在 Python 中使用 H2OAutoML 创建回归模型,但我找不到如何通过 'weights_column'.

我尝试了这两种方式:

# Create the AutoML model.
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'

# Create the AutoML model.
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')