Skip to Content
Author's profile photo Tammy Powlas

Working with Association Analysis SAP Predictive Analytics 2.0 using R

First, there is this nice blog here about how it works with HANA Basket Analysis with SAP Predictive Analysis and SAP HANA – Part 1

I also looked at Wikipedia for Association Rules: Association rule learning – Wikipedia, the free encyclopedia

But if you don’t have HANA, and are unfamiliar, using a text file is an easy way to get started.  This time I am using the Expert Analytics part of Predictive Analytics (although I am not an expert, really)

1expertR.png

Figure 1

First I realize that I can’t access any Association algorithms because I haven’t installed R.  Fortunately that is fairly easy and quick in this version.

/wp-content/uploads/2015/04/2config_678356.png

Figure 2

After installing, you are asked if you want to Configure R – please press OK (and not cancel like I first did)

/wp-content/uploads/2015/04/3configswitch_678357.png

Figure 3

The only configuration item is to select “Enable Open-Source R Algorithms”.  Select that and click OK

/wp-content/uploads/2015/04/4pref_678358.png

Figure 4

Initially when I launched SAP Predictive Expert Analytics it always took me to the “Visualize” room.  I decided I wanted to go to the Predict room first so I change that in Preferences.

/wp-content/uploads/2015/04/5configureaprio_678359.png

Figure 5

In the Predict room, I select R-Apriori under association and configure as shown above.  I have a CSV file that has products and “baskets” (transactions)

/wp-content/uploads/2015/04/6raprio_678360.png

Figure 6

Once the items are “configured” you see a checkbox as shown above.

/wp-content/uploads/2015/04/7success_678361.png

Figure 7

I run the model without any issues (success) and click OK

/wp-content/uploads/2015/04/8grid_678365.png

Figure 8

The above shows the results view.  I consult wikipedia about Lift and confidence.  A lift of > 1 is useful for predicting, according to Wikipedia Lift (data mining) – Wikipedia, the free encyclopedia

/wp-content/uploads/2015/04/9algorithm_678366.png

Figure 9

Figure 9 shows the algorithm summary with 17 transactions (baskets) – this is a small dataset.

/wp-content/uploads/2015/04/10tag_678367.png

Figure 10

Figure 10 is a cloud chart which is part of the results set.  The strongest associations are shown in large text size

/wp-content/uploads/2015/04/11output_678371.png

Figure 11

Figure 11 shows I decide to output the results set to a CSV file so I can try more visualizations of the results.

/wp-content/uploads/2015/04/12heatmap_678372.png

Figure 12

Figure 12 shows the results using a heat map with Lift as the color

/wp-content/uploads/2015/04/14heat_678373.png

Figure 13

I switch the Lift and Confidence around and now with the size of the rectangle is influenced by Lift and Color is impacted by the confidence of the rule.

/wp-content/uploads/2015/04/13related_678380.png

Figure 14


I can also try the “related visualizations”


Off-topic:

When I hear the word “association” I can’t help but think of the group Association, the a great musical group from the 60’s:


Enjoy the music.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.