我使用model.download_mojo(path="path", get_genmodel_jar=True)
保存了H2O模型。
我想再次在jupyter笔记本中使用该模型。
我怎样才能做到这一点?谢谢。
答案 0 :(得分:1)
您可以这样做:
data = h2o.import_file(path='training_dataset.csv')
original_model = H2OGeneralizedLinearEstimator()
original_model.train(x = ["Some column", "Another column"], y = "response", training_frame=data)
path = '/path/to/model/directory/model.zip'
original_model.download_mojo(path)
然后在新笔记本中执行以下操作:
path = '/path/to/model/directory/model.zip'
imported_model = h2o.import_mojo(path)
new_observations = h2o.import_file(path='new_observations.csv')
predictions = imported_model.predict(new_observations)
[摘自文档的本页: