4
votes

I built a deep learning model using h2o in R. I saved the model using the command

save(model,file="my_model.RData")

But now when I am predicting using the saved model ,it is giving me error message.I should have saved the model using h2o.savemodel.

h2o.savemodel(model)

Is there a way around it so that I can use my model now for prediction?

1

1 Answers

3
votes

If you have not yet already shutdown the H2O instance where the model was made, you can still go and get it again. Either find it in Flow, and save from there, or in an R session, use model = h2o.getModel("theModelId") (if you don't know the model ID, that is one of the few useful things you will be able to find in your "my_model.RData" file).

But I'm guessing you have already shut it down, in which case, sorry, there is no way back. You will need to rebuild the model.

Background: I think you've already realized, but for anyone else reading this, the model object in your R session is just a summary of information about the model, a collection of meta data about it. The actual model exists not in the R client, but in the H2O cluster, so has to be saved with an H2O command.