1
votes

I am new to Apache Mahout recommender. The use case involves providing suggestions to users based on their purchase history. I am planning to use the following information :

  • Purchase category
  • Purchase amount
  • Time of purchase (Example - recommend a pair of denims 6 months after the first pair was bought)
  • Location of user

To identify users with similar purchase pattern/time of purchase and give them more preference, do I have to make custom data model for every user? I was planning to import from the database periodically to recreate the data model. Is there a way to dynamically give preference like mentioned below:

  1. Location + purchase category + time match
  2. Purchase category + time match
  3. Location + time match (example winter clothing)

Currently I am using the sample code provided. (A lot of modifications are needed)

UserSimilarity similarity = new PearsonCorrelationSimilarity(model);
        UserNeighborhood neighborhood = new ThresholdUserNeighborhood(0.1, similarity, model);
        UserBasedRecommender recommender = new GenericUserBasedRecommender(model, neighborhood, similarity);
        List<RecommendedItem> recommendations = recommender.recommend(74, 10);
1

1 Answers

1
votes

In general, to achieve what you are sugguesting you need to do a step on your data where you add a feature like t_since_last_purchase which in an integer 0 -> inf. E.g. days since last purchase.

This feature, time, will be another user feature which is correlated.

I think you are looking at some of the older Map-Reduce based reccomenders- which are in fact first class- but given your use case, you might want to check out coorelated cooccurence based reccomenders which have a significant benefit of being able to look at multiple activities of the user (in your case, location, previous purchases, time).