2
votes

I am trying to build a recommendation engine using Mahout that gives recommendations solely based on item-to-item similarity, not taking into account user preferences (i.e. ratings). The item similarities are calculated by some other process external to mahout and saved to a file. So far, I have determined that I can use the class:

GenericBooleanPrefItemBasedRecommender

...to pick items, which the documentation says is "appropriate for use when no notion of preference value exists in the data." However, the class still takes as input:

(DataModel dataModel, ItemSimilarity similarity)

I know I can use ItemSimilarity class to supply the item-to-item similarity value, but what is my datamodel in this case? I have no preferences, which seems to be the exact thing the datamodel represents. how do I work around this, or am I looking at the wrong thing here?

2

2 Answers

2
votes

Here is a simple code how you can create an instance of your DataModel that uses GenericBooleanPrefDataModel

DataModel model = new GenericBooleanPrefDataModel(GenericBooleanPrefDataModel.toDataMap(new FileDataModel(new File("YOUR_FILE_NAME"))));

However, even if you have data model with preference values, and you have custom implementation of ItemSimilarity that does not use this preference values, you will get the desired result.

Best, Dragan

0
votes

Simply use a GenericBooleanPrefDataModel.