阿帕奇星火MLlib模型文件格式 [英] Apache Spark MLlib Model File Format
问题描述
阿帕奇星火MLlib算法(例如,决策树)保存在一个位置模式(例如, myModelPath
)其中它创建两个目录,即 myModelPath /数据
和 myModelPath /元
。有在这些路径的多个文件,而这些都是不文本文件。有格式 *。实木复合地板
的一些文件。
我有几个问题:
- 什么是这些文件的格式?
- 哪个文件/文件包含实际的模型?
- 我可以在模型保存到其他地方,例如在DB?
这些是什么文件格式?
块引用>
数据/ *。实木复合地板
文件在阿帕奇木地板一>列存储格式为:元/一部分 - *
看起来像JSON
哪个文件/文件包含实际的模型?
块引用>
模式/ *。实木复合地板
我可以在模型保存到其他地方,例如在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
andmyModelPath/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?
data/*.parquet
files are in Apache Parquet columnar storage formatmetadata/part-*
looks like JSONWhich 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屋!