【问题标题】:How to read SEQ files in pig如何在 pig 中读取 SEQ 文件
【发布时间】:2014-11-25 17:44:53
【问题描述】:

我有 M、U 和 userRatings 部分文件作为 ALS 矩阵分解过程的中间结果。

标题是:

序列。 org.apache.hadoop.io.IntWritable%org.apache.mahout.math.VectorWritable

我需要使用该向量/特征来查找 ALS 建议的解释(这是一个猜测)。它需要在 PIG 上。

谢谢, 呃

【问题讨论】:

标签: hadoop apache-pig mahout mahout-recommender


【解决方案1】:

试试这个链接,它有很多关于如何使用大象鸟加载、存储和处理 SEQ 文件的示例。

例如:

     pair = LOAD '$data' USING com.twitter.elephantbird.pig.load.SequenceFileLoader (
       '-c com.twitter.elephantbird.pig.util.IntWritableConverter', 
       '-c com.twitter.elephantbird.pig.mahout.VectorWritableConverter'
     ) AS (key: int, val: (f1: double, f2: double, f3: double));

http://grepcode.com/file/repo1.maven.org/maven2/com.twitter.elephantbird/elephant-bird-mahout/3.0.1/com/twitter/elephantbird/pig/mahout/VectorWritableConverter.java

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-02
    相关资源
    最近更新 更多