导出和导入模型Export and import models

若要保存模型,请使用 MLflow 函数 log_model 和 save_modelTo save models, use the MLflow functions log_model and save_model. 你还可使用模型的原生 API 将模型保存到 Databricks 文件系统 (DBFS) 上。You can also save models using their native APIs onto Databricks File System (DBFS). 对于 MLlib 模型,请使用 ML 管道For MLlib models, use ML Pipelines.

若要导出模型来进行单个预测,可使用 MLeap,它是机器学习管道的一种常见序列化格式和执行引擎。To export models for serving individual predictions, you can use MLeap, a common serialization format and execution engine for machine learning pipelines. MLeap 支持将 Apache Spark、scikit-learn 和 TensorFlow 管道序列化处理成一个捆绑包,让你能够加载和部署已训练的模型,使用新数据作出预测。MLeap supports serializing Apache Spark, scikit-learn, and TensorFlow pipelines into a bundle, so you can load and deploy trained models to make predictions with new data. 可将导出的模型导入 Spark 和其他平台来进行评分和预测。You can import the exported models into both Spark and other platforms for scoring and predictions.

Databricks Runtime 5.5 LTS 上,你可使用 Databricks ML 模型导出On Databricks Runtime 5.5 LTS you can use Databricks ML Model Export.