BookmarkSubscribeRSS Feed

Tip: Making Recommendations Using SAS® Enterprise Miner™ Link Analysis Node

Started ‎04-28-2014 by
Modified ‎10-06-2015 by
Views 2,845

The Link Analysis node in SAS Enterprise Miner can make recommendations to customers based on their transactional history data by providing a next-best-offer list.

 

In this tip, I’ll cite an example to demonstrate how to use the Link Analysis node to get next-best-offer list for transactional data. If you are interested in how the Link Analysis node generates the next-best-offer list, refer to the paper, Link Analysis Using SAS® Enterprise Miner™, for details.

 

Example

 

The example data set in this example is modified from data SAMPSIO. ASSOCS (stored in the sample library) contains 7,007 separate customer transactions. CUSTOMER is an ID variable that identifies the customers. PRODUCT is the nominal target variable.

 

We use the first 801 customers’ transaction data as the training data, and use the rest of the data as the data to be scored.

 

data assoc_train;

set sampsio.assocs(where=(customer le 800));

run;

 

data assoc_score;

set sampsio.assocs(where=(customer gt 800));

run;

 

Create a flow like the one in Display 1:

 

image001.png

                                Display 1. Link Analysis Flow

 

First, use the following steps to configure the flow:

  1. Set the role of data assoc_train to Transaction, and set the role of data aasoc_score to Score.
  2. Set the variable roles for both data as follows:

        Right-click on each Ids (input data set) node and select Edit Variables. Assign the roles as shown in Display 2.

 

                     image002.png

 

                                Display 2. Variable Roles

   3. Adjust the Score property of Link Analysis to get next-best-offer list. If you set Generate Recommendation Table to Yes (the default setting) in the Score property window, the next-best-offer list is displayed in the score output. You can export the full recommendation table, or the filtered recommendation table that results from specifying properties such as “Top N,” “Minimum Confidence (%),” and “Criterion Relation,” as shown in Display 3.

 

                  image003.png

                     Display 3. Recommendation Table Properties Window

 

   4. Leave all other properties in the nodes of the flow as default, run the flow.

 

               image004.png

 

                       Display 4. Filtered Recommendation Table for Training Data

 

If you specify the settings shown in Display 3, a filtered recommendation table is displayed in Link Analysis node’s Results window, as shown in Display 4. The table contains the top three next-best offers for each of the customer ID from 0 to 800.

 

Now click on the Score node, and go to the property panel of it, as shown in Display 5.

 

Click to open the exported score data in the Score node, you will find the top-3 next-best-offers for customer ID from 801 to 1000, as shown in Display 6. For example, cracker, olives and corned beef are recommended for customer 801.

 

               image005.png

     Display 5. Score Code Property Panel

 

image006.png

Display 6. Filtered Recommendation Table for Score Data

 

               

Version history
Last update:
‎10-06-2015 02:10 PM
Updated by:
Contributors

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags