h2o H2OGenericEstimator 训练功能不起作用

问题描述 投票:0回答:1

我想使用 H2O 模型启用增量训练。我使用 MOJO 格式保存现有数据集/观察结果的训练模型。收到新的观察结果后,我想加载基于 MOJO 的模型并根据新的观察结果重新训练现有模型。然而,这不起作用。

或者,我可以使用特定的模型类来训练模型,例如组合数据集上的 H2OGradientBoostingEstimator ,但这需要我跟踪所有以前的观察结果并导致更高的磁盘使用率。

H2OGenericEstimator 的

H2O 文档显示了对训练功能的支持。然而,根据实验,train 函数并没有真正产生任何区别。

from h2o.estimators import H2OGenericEstimator, H2OXGBoostEstimator
import tempfile
airlines= h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/testng/airlines_train.csv")
y = "IsDepDelayed"
x = ["fYear","fMonth","Origin","Dest","Distance"]
xgb = H2OXGBoostEstimator(ntrees=1, nfolds=3)
xgb.train(x=x, y=y, training_frame=airlines)
original_model_filename = tempfile.mkdtemp()
original_model_filename = xgb.download_mojo(original_model_filename)
key = h2o.lazy_import(original_model_filename)
fr = h2o.get_frame(key[0])
model = H2OGenericEstimator(model_key=fr)
model.train()
model.auc()

有没有办法训练使用MOJO文件加载的模型?

python h2o
1个回答
0
投票

目前从 mojo 文件加载的 h2o 通用估计器可以执行评分,但无法再次训练。

如果您有兴趣训练以前构建的模型,请考虑使用检查点。这是有关它的文档:https://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/algo-params/checkpoint.html#:~:text=The%20checkpoint%20option %20允许%20you,继续%20建筑%20a%20上一个%20模型

© www.soinside.com 2019 - 2024. All rights reserved.