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:
Display 1. Link Analysis Flow
First, use the following steps to configure the flow:
Right-click on each Ids (input data set) node and select Edit Variables. Assign the roles as shown in Display 2.
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.
Display 3. Recommendation Table Properties Window
4. Leave all other properties in the nodes of the flow as default, run the flow.
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.
Display 5. Score Code Property Panel
Display 6. Filtered Recommendation Table for Score Data
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.