Question

Is there any way to pass a JSON feed into the Mahout recommender? So far the DataModel's present in Mahout can take a text file or read a table from a database to obtain the ratings and items for a user. However, I would like to link Mahout to a JSON feed (or submit a link to a Google doc) where ratings are continuously changing. I do not want to link Mahout to a database.

Is there any way to do this? I googled for it but the authority on the web seem to suggest that the only way to pass in ratings and items is either through a txt file or database. I would appreciate greatly a workaround for this.

Was it helpful?

Solution

There isn't any such pre-built DataModel provided by Mahout, which can read from JSON. The ones currently available can be found here

You can implement your own DataModel. Have a look at FileDataModel and MongoDBDataModel

OTHER TIPS

Mahout is not a system for creating online recommendation systems (see Storm for this purposes, for example: http://storm.incubator.apache.org), so you can not link Mahout to a JSON feed where ratings are continuously changing. But you can periodically re-create recommender using current data file (each day or each hour).

For parsing JSON data you could use any java JSON parser (for example http://jackson.codehaus.org) and/or hadoop's RecordReader (PatternRecordReader) and InputFormat (PatternInputFormat).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top