on 08-18-2015 3:48 PM
Hi all
I've recently started using the SAP Predictive Analytics Product Recommendation Model. It's really easy to use and looks like an easy win in terms of improving sales.
I'd like to know what's the best way to go about restricting the recommendations to a given list. I'll provide the context and reasoning in the example below
Say we have a database of Customer ID's and Products purchased. We then want to create product recommendations but only for products that we currently have stock of. The following is the steps one could take to do this:
1. Create the model based on all product/customer combinations i.e. whether we have stock for the product or not
2. Run the model on all customers
3. Export the results
4. Filter out the recommended products for which we don't have stock
The reason I didn't filter my results to start off with (ie create the model only for products where stock is available) is that I want the rules to be created irrespective of whether there's stock now, so that when the rule is applied and it sees that Customer X purchased Product Y (which currenly there is no stock of, but the purchase was made last month), then it recommends product Z (which we do have stock of). Hence, the rules need to be created on all products and not just those for which we have stock of.
Is there a better way to do this? Due to the number of recommendations per customer the data gets large rather quickly, so if there's a better way to do this, I'd love to know
Many thanks
Ria
Hi All
Let me update this question and finally mark it as answered
It seems that the best way to limit recommendations to certain criteria (e.g. items with stock > 0) is a combination of SAP PA and another programming language (e.g. SQL). The following are the steps involved
1. Run the model using SAP PA Product Recommendation Engine - run it on all transactions
2. After generating the model, save the model as a database
3. The database that you have saved has ALL the recommendations per item
4. Using this database, and others e.g. transactional db which has previously purchased items, or a stock table which has stock levels - one can create a query which can give you exactly what you want e.g. top 5 items where stock is greater than X
I'm busy putting together a short doc on exactly what to do as I'm sure many of you will find it useful.
Regards
Ria
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ria,
Have all our questions been answered or not yet?
Thanks & regards
Antoine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ria,
Have you had a chance to look into the suggested response?
Thanks for sharing your feedback
@bdel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ria,
Here is the user guide for Social: http://help.sap.com/businessobject/product_guides/pa23/en/pa23_social_user_en.pdf
Marc
Hi Marc
Thanks. I should have stated that I have gone through the User Manual and still I'm not sure how to derive the graph. The user manual was not helpful - it states the following:
"This option is only available when a bipartite graph has already been created in the current model, either from a data set or loaded from an existing model."
However my issue is that selecting the "Derive Graph from a Bipartite Graph:" option is only available at the start of the process. How does one get back to this step after creating the bipartite graph?
Any ideas? Have you perhaps created such a model?
Cheers
Ria
Hi Ria,
Here is an example of Deriving a graph from a bi-partite graph.
You first start with a graph of type Transactions (user guide Chapter 4.6.2)
You can use the data set customers_transactions.txt that is delivered with the product under the folder .../Samples/KAR
You create a Transaction graph. Then Click on Add Graph.
Choose menu Derive Graph.
Specify the entity (here user)
A new graph is added
Marc
Hi Ria,
My response will be related to Automated Analytics.
I will assume you have created a "Recommender" model.
The "Recommender" flow was build as simple as possible, and therefore misses some filtering features available in "Social".
Keeping in mind that a "Recommender" model exposes a subset of the "Social" model, we can easily build the same model and use the filtering option.
In your case you can use the "Target Event" field to identify product available in stocks from your transaction dataset. Then when deriving the transaction graph, you can enable the "Target Event Required" option to filter the derived and keep rules where at least one of the item has a "true" target.
During the model creation phase, an additional filtering step will be applied.
I was able to test this in SAP Predictive Analytics 2.0, Automated Analytics.
Regards
@bdel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abdel
I've been trying to follow your suggestion struggling to to do so. The issue I'm having is where to define the "Target Event" field.
The following are the steps I'm taking in the creation of my model:
1.Open SAP PA Automated Analytics
2. Select "Create a Social Network Analysis"
3. Select "Build a Social Graph From a Data Set"
4. Load and link my data set
5. Create first graph
5.1. Graph type = Transactions
5.2. Source Node = CustomerKey
5.3. Target Node= Product
6. Create second graph
6.1. Add graph
6.2. Derive from a bipartite graph
6.3. Entity = Product (at the end I want to recommend products for customers based on the product rules established and the products they already have)
6.4. Min Support = 2
6.5. Weight = Jaccard Index (recommended from help section)
6.6. Max iterations = 1
6.7. Filters: Unselect Min Pred Power (default setting for Product Recommendation engine)
7. Graphs are now setup, go through rest of steps without changing anything and generate model
At which point in the above steps should I have set the Target Event field?
FYI - the Help section on the Target Event doesn't really help. Furthermore, the only referecen to a Target Event in the User Manual states that "In the Candidate List tab, you can define the population of your graphs by checking the Target Event Required option. " However I can't find anything more on this topic
I've attached the test data set that I'm trying to build this model on.
Many thanks
Ria
Hi,
I think there is a regression in the product, the target event field has been removed since PA 2.0 for a reason that I cannot explain.
I found the related defect in Jira and this should be fixed in 2.4.
The feature still exist but via KxShell scripting which what I tested initially.
Regards
@bdel
Hi Abdel
I followed your suggestion and did the the following:
In my input data I created a column called "Use" which has values of "Yes" and "No"
I then opened the Social Model and created the first social graph as "Transactions" graph type with the Target set to the field called "Use" and the Target Key set to Yes
I then create the second graph derived from the above bipartite graph and generate the model
It worked great and restricted my results to only products that had a "Use" = Yes in the input data
HOWEVER,
I tried running a new model with EXACT same approach outlined above Except that I changed the Target Key from Yes to No
In this instance when I generate the model then the results are not filtered to products that had a "Use" = No in the input data. Any idea what's going on here? Why does it work for Yes and not No?
Thanks
Ria
My answer is in response to the Expert Analytics Apriori algorithm, I can't speak to the Automated Analytics algorithm.
I don't really think there is a good solution besides what you have proposed because you are probably going to be having stock changes more frequently than you would run product suggestion rules.
How are you inputting your data (Tabular vs Transaction format)? If in transaction format (where you give the algorithm the basket ID and the product name, then definitely not (if you want to include out of stock products in the antecedent).
If you are putting it in tabular format, I believe this preserves purchase order, allowing users to put in columns for "product 1", "product 2", etc... in some sort of theoretical order (purchase timing, etc...) If you were inputting data in tabular format, you could simply eliminate any baskets that included OOS products for Product 2+ entries, though that would also eliminate any suggestions for Product 1 + Product 2 => Product 3. Also, unless you are running rules on demand for every suggestion, your OOS list might change, so I doubt this would be a very practical suggestion.
If you just want fewer suggestions per customer, you can tweak the confidence thresholds, but I think that eliminating suggestions for OOS products is useful outside of just narrowing down suggestions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.