R h2o load a saved model from disk in MOJO or POJO format

前端 未结 3 2210
一生所求
一生所求 2021-02-15 14:22

I\'m catching up on h2o\'s MOJO and POJO model format. I\'m able to save a model in MOJO/POJO with

h2o.download_mojo(model, path = \"/media/somewhe         


        
3条回答
  •  -上瘾入骨i
    2021-02-15 14:53

    If you are looking to make predictions on an H2O model in R, then you have three options (which method you choose depends on your use-case):

    1. You can use a binary model instead of a MOJO (or POJO). For this method, you export the model to disk using h2o.saveModel() and load it back into the H2O clsuter using h2o.loadModel() and make predictions using predict(model, test). This method requires having an H2O cluster running.
    2. If you's still prefer to export a model to MOJO (or POJO) format, you can use the h2o.mojo_predict_df() or h2o.mojo_predict_csv() function in R to generate predictions on a test set (from an R data.frame or in a CSV file).
    3. As an alternative to #2, if your data is in JSON format, you can use h2o.predict_json(), but it will only score one row at a time.

提交回复
热议问题