Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Ian_Henry
Product and Topic Expert
Product and Topic Expert


Following on from Part1, Basket Analysis with SAP PA and SAP HANA, I want to take this furter. Showing how to do some further analysis of the Market Basket Analysis (MBA) output using SAP HANA Studio, SAP Predictive Analysis (PA) and/or SAP Lumira.

The output of the Basket Analysis, Association Analysis (HANA Apriori algorithm) is very straightforward:

It shows the product purchased (PreRule), the secondary product(s) (PostRule), and then some calculated fields - Lift, Support and Confidence. Wikipedia can give you the details how each of these is calculated.  When performing MBA, we can choose if we are looking for a match between 2 products or more than 2 by using Aprori or Apriori Lite respectively.

I have found that the lift is the most useful of these columns as it combines the support and confidence to give you an idea of how good the rule is.  For example does it occur frequently and if one product is found how likely is it that the other product will be in the same basket.

In HANA studio we can easily see this output and build a simple Analytic View (AV) for us to consume in PA/Lumira.

The Analytical View allows us to derive a new field and then specify some metadata such as the measure columns.


 

Below is the output table definition created in Part1



 

And here's the data that holds



 

We can build a simple Analytical View with just this table



 

I have found it useful to combine the PreRule and PostRule into a single field, we do this with a calculated column as below.



 

We need to specify the Aggregation for the measures, even if there is not really an appropriate type, but as we will also include the Rule or the PreRule and PostRule SUM will suffice.



 

Using SAP Lumira / Predictive Analysis to create some further visualisations using this Analytical View.

See Below for a selection that I have created in just a few clicks.

 









 



Some further blogs on these topics include are linked below.


The SAP HANA Effect, looking at how this changes the business process and analysis of basket data.  

Enhancing Market Basket Analysis with PA 2.0 and SAP HANA, includes some additional techniques that can be applied to Basket Analysis to get even more insights.


1 Comment