使用R中的h2o包保存模型时如何指定文件名 [英] How to specify the file name when saving the model using h2o package from R
问题描述
I am trying to save the model build using the function: h2o.saveModel()
, based on function description on page 159 of the H2O user manual for R, the arguments only consider path
. I looked at other similar function such as: h2o.saveModelDetails()
but it uses the same argument. Please advise if there any another way to specify the name of the model.
推荐答案
模型文件的名称将由模型的ID决定.因此,如果在训练模型时指定model_id
,则可以对其进行自定义.现在,在训练模型后,无法更改其ID.
The name of the model file will be determined by the ID of the model. So if you specify model_id
when training your model, then you can customize it. Right now there is no way to change the ID of the model after it's been trained.
文件一旦保存即可重命名:
The file can be renamed once saved:
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)
这篇关于使用R中的h2o包保存模型时如何指定文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!