Skip to Content

Product Recommendations: demystify the algorithms please

Hello experts,

I am trying to understand the appropriate business scenarios for using the different product recommendation algorithms. What are the best use cases for the APRIORI_LITE and the FP-Growth algorithms/

The definition I see from is this:

"These algorithms use records from the data source SAP Hybris Marketing Interactions. The records are grouped by customer ID using FP-Growth (multiple leading items) or Apriori Lite (one leading item) respectively."

Does this mean that the FP-Growth algorithm is a better choice in a View Cart or Checkout page where there could be multiple products (and therefore multiple leading items) in the cart and the APRIORI_LITE is a better (or maybe an equal) choice when it comes to, say, a Product view page?



Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Posted on Feb 16, 2017 at 09:49 AM

    Hi Ajit,

    well..., let me give a try as I understood it from my experts:

    AprioriLite will give 1:1 rule association results which means if you have 2 (x,y) items in the basket you will get associations for each one only meaning:
    - Customer bought product x also bought product A : x->A
    - Customer bought product y also bought product B : y->B

    But you will not get that someone that bought products x and y at the same time also bought products A and B (x,y) -> (A,B) for this user will have to select FP-Growth algorithm.

    For instance, if you are a Food retailer, FP-Growth will be able to tell you the following:

    You have put in the basket:
    -Pizza Crust + Cheese + Red Pepper

    You may get interested in (all together)

    - Tomato sauce + Pepperoni
    - Tomato sauce + Ham + Pine Apple
    - Bechamel sauce + shrimp

    To quote the developer: "I think that in 90% of the case, Apriori-Lite/SQL Association is good enough. FP is for advanced topics which goal is to provide for a group of product another group of product. Please note also that due to its nature, FP-Growth consumes more resources overall."

    Hope this helps.



    Add comment
    10|10000 characters needed characters exceeded

    • Thank you Matthias, that was really helpful.

      A follow-up question on that: So typically this would be used in cases where there are more than one leading products like on the checkout page where the customer is viewing the multiple products in the cart. If there are 5 products in the cart (A, B,C,D and E), would the FP-Growth algorithm pick out combinations of subsets from within the 5 and then recommend other products? For example : Products W and X are often bought together with A, C and D but have no combinations with products B and E. Will the FP-Growth algorithm pick W and X?

  • Posted on Feb 27, 2017 at 05:07 PM

    Hi Ajit,

    Yes, FP-Growth will pick up subsets and so will AprioriLite. Suppose your leading items are {x1, x2, ..., xn}. In the case of FP-Growth, the subsets are actually involved in association rules of the form X -->yj, where X is a subset of {x1, x2, ..., xn}. In the case of Apriori Lite, the subsets come from individual rules of the form xi --> yj.

    To make this a little more concrete, suppose you have {Pizza Crust, Cheese, Red Pepper} in your basket. FP-Growth might return (Tomato sauce, Pineapple, Bechamel sauce, Shrimp, Crackers). These results would come from rules that look like:

    {Pizza Crust, Cheese, Red Pepper} -> Tomato sauce 
    {Pizza Crust, Cheese, Red Pepper} -> Pineapple 
    {Pizza Crust, Cheese, Red Pepper} -> Bechamel sauce
    {Pizza Crust, Cheese, Red Pepper} -> Shrimp 
    {Pizza Crust, Cheese}             -> Bechamel sauce
    {Pizza Crust, Red Pepper}         -> Bechamel sauce
    {Cheese}                          -> Crackers

    Apriori Lite, on the other hand, might return some or all these results and most probably others as well, as in (Nachos, Crackers, Tomato sauce, Bechamel sauce, Green Pepper). These results would come from rules that look like:

    Pizza Crust -> Tomato sauce 
    Pizza Crust -> Bechamel sauce 
    Cheese      -> Nachos
    Cheese      -> Crackers
    Red Pepper  -> Green Pepper 

    The reason the results might be different is that some results are filtered out by the threshold parameters Minimum Support, Minimum Confidence and Minimum Lift. Also, there is the Max. Number of Recommendations parameter that is used to cut out some results based on the choice of the Score Type parameter.

    Add comment
    10|10000 characters needed characters exceeded