I am working on an E-Commerce website. I want to create a recommender based on user's product view history using Apache Mahout. Right now, I am able to generate recommendations based on rating data that user provides. Right now, the input to the recommender is user_id, item_id and ratings. I want to create a recommender which generates recommendations based on the products viewed by the user. Can anyone tell me how this can be achieved?
PS. I need to use Apache Mahout.
Mahout can handle boolean preferences which your implicit ratings are. Boolean datamodels can be created from csv files or databases with PostgreSQLBooleanPrefJDBCDataModel or MySQLBooleanPrefJDBCDataModel classes. Main difference with recommendations with non-boolean ratings is that with boolean preferences, similarities should be Tanimoto or Log Likelihood similarities. So the example code from Mahout homepage would look like this:
DataModel model = new FileDataModel(new File("booleanpref.dat"));
UserSimilarity userSimilarity = new TanimotoCoefficientSimilarity(
model);
UserNeighborhood neighborhood = new NearestNUserNeighborhood(3,
userSimilarity, model);
Recommender recommender = new GenericUserBasedRecommender(model,
neighborhood, userSimilarity);
Recommender cachingRecommender = new CachingRecommender(recommender);
List<RecommendedItem> recommendations = cachingRecommender
.recommend(1234, 10);
This blog gives examples for item-based boolean recommendations.