Mahout:读取自定义输入文件 [英] Mahout : To read a custom input file

查看:106
本文介绍了Mahout:读取自定义输入文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在玩Mahout,发现FileDataModel以

格式接受数据。

$ p $ user $,itemId,pref(long,长,双)。

我有一些格式为

 字符串,long,double 

什么是最好的/ mashout上使用这个数据集最简单的方法吗?

解决方案

userId和itemId可以是字符串,所以这是CustomFileDataModel ,它会将你的字符串转换为整数,并将map(String,Id)保存在内存中;建议之后,您可以从ID获取字符串。


I was playing with Mahout and found that the FileDataModel accepts data in the format

     userId,itemId,pref(long,long,Double).

I have some data which is of the format

     String,long,double 

What is the best/easiest method to work with this dataset on Mahout?

解决方案

userId and itemId can be string, so this is the CustomFileDataModel which will convert your string into integer and will keep the map (String,Id) in memory; after recommendations you can get string from id.

这篇关于Mahout:读取自定义输入文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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