如何在H2OAutoML中设置列的权重?

2024-04-29 10:49:12 发布

您现在位置:Python中文网/ 问答频道 /正文

我曾尝试在Python中使用H2OAutoML来创建回归模型,但我找不到如何传递“weights\u 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

有人能帮我使用这个参数吗?谢谢


Tags: thenonemodelincludecreatecolumnmaxruntime
1条回答
网友
1楼 · 发布于 2024-04-29 10:49:12

您可以从.train()方法调用weights_column。例如:

aml.train(x=x, y=y, training_frame=train, weights_column='weight')

相关问题 更多 >