阿帕奇星火MLlib模型文件格式 [英] Apache Spark MLlib Model File Format

查看:190
本文介绍了阿帕奇星火MLlib模型文件格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阿帕奇星火MLlib算法(例如,决策树)保存在一个位置模式(例如, myModelPath )其中它创建两个目录,即 myModelPath /数据 myModelPath /元。有在这些路径的多个文件,而这些都是不文本文件。有格式 *。实木复合地板的一些文件。

我有几个问题:


  • 什么是这些文件的格式?

  • 哪个文件/文件包含实际的模型?

  • 我可以在模型保存到其他地方,例如在DB?


解决方案

  

这些是什么文件格式?



  

哪个文件/文件包含实际的模型?



  • 模式/ *。实木复合地板


  

我可以在模型保存到其他地方,例如在DB?


我不知道有任何直接的方法,但你可以加载模型作为数据帧,并将其存储在数据库中算账:

  model_df = sqlContext.parquetFile(/路径/到/ data /)
model_df.write.jdbc(...)

Apache Spark MLlib algorithms (e.g., Decision Trees) save the model in a location (e.g., myModelPath) where it creates two directories, viz. myModelPath/data and myModelPath/metadata. There are multiple files in these paths and those are not text files. There are some files of format *.parquet.

I have couple of questions:

  • What are the format of these files?
  • Which file/files contain actual model?
  • Can I save the model to somewhere else, for example in a DB?

解决方案

What are the format of these files?

Which file/files contain actual model?

  • model/*.parquet

Can I save the model to somewhere else, for example in a DB?

I am not aware of any direct method but you can load model as a data frame and store it in a database afterwards:

model_df = sqlContext.parquetFile("/path/to/data/")
model_df.write.jdbc(...)

这篇关于阿帕奇星火MLlib模型文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆