我正在尝试使用以下函数保存模型构建:h2o.saveModel()
,基于 H2O user manual for R 第 159 页上的函数描述,参数仅考虑path
。我查看了其他类似的函数,例如: h2o.saveModelDetails() ,但它使用相同的参数。请告知是否有其他方法来指定模型名称。
最佳答案
模型文件的名称将由模型的 ID 确定。因此,如果您在训练模型时指定 model_id
,则可以自定义它。目前,模型训练完成后无法更改其 ID。
文件保存后可以重命名:
h2o.saveModel(object = fit, path = path.value, force = TRUE) # force overwriting
name <- file.path(path.value, fileName) # destination file name at the same folder location
file.rename(file.path(path.value, fit@model_id), name)
关于h2o - 使用 R 中的 h2o 包保存模型时如何指定文件名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48833097/