Pedro Schuller
Pedro Schuller

Reputation: 325

How to reassign model_id in h2o

Is there a way to assign a new id to an existing h2o model obtained by AutoML/grid?

AUTO <- h2o.automl(training_frame = train,
                            x = input, y = "Sales",
                            fold_column = "Week",
                            seed = 1, max_models = 8)
model <- AUTO@leader

Neither of these options work:

model@model_id <- "new_model_id"
model@parameters$model_id <- "new_model_id"
model@allparameters$model_id <- "new_model_id"
attr(model, "model_id") <- "new_model_id"

When I try to save the model, h2o throws an error:

model_path <- h2o.saveModel(model, path = getwd(), force = T)

Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = page,  : 

ERROR MESSAGE:

Object 'new_model_id' not found for argument: model_id

Is what I'm trying to do even possible? Thank you!

Upvotes: 5

Views: 1025

Answers (1)

Lauren
Lauren

Reputation: 5778

This functionality is currently not available in the R API, so I created a jira ticket here: https://0xdata.atlassian.net/browse/PUBDEV-5248

In the Python API, however, you can do

my_model.model_id = ‘my_new_model_id’

Upvotes: 5

Related Questions