简体   繁体   English

如何将 H2O 苏打水模型保存到磁盘

[英]How do I save H2O Sparkling Water models to disk

I have a PySpark code to train an H2o DRF model. I need to save this model to disk and then load it.我有一个 PySpark 代码来训练 H2o DRF model。我需要将这个 model 保存到磁盘然后加载它。

from pysparkling.ml import H2ODRF
drf = H2ODRF(featuresCols = predictors,
                labelCol = response,
                columnsToCategorical = [response])

I can not find any document on this so I am asking this question here.我找不到关于此的任何文件,所以我在这里问这个问题。

I think the section of the docs on deploying pipeline models might be relevant: https://docs.h2o.ai/sparkling-water/2.3/latest-stable/doc/deployment/pysparkling_pipeline.html我认为关于部署管道模型的文档部分可能是相关的: https://docs.h2o.ai/sparkling-water/2.3/latest-stable/doc/deployment/pysparkling_pipeline.html

Pipelines may not be what you're looking for depending on the use case.根据用例,管道可能不是您正在寻找的东西。

Something like the following might work for your use case.以下内容可能适用于您的用例。

drf = H2ODRF(featuresCols = predictors,
                labelCol = response,
                columnsToCategorical = [response])

pipeline = Pipeline(stages=[drf])

model = pipeline.fit(data)
model.save("drf_model")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM