SAS Data Science

Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Viya (Machine Learning), SAS Visual Text Analytics, with point-and-click interfaces or programming
BookmarkSubscribeRSS Feed
kjsj400
Fluorite | Level 6

I have tried to do the sequence analysis using association node and final aim is to get the Next-Best Offer but I am unable to generate the recommendations at the user level since only output is the rules.

 

Kindly revert if anyone has faced the same problem. Early revert will be appreciated.

2 REPLIES 2
DougWielenga
SAS Employee

You can obtain single step recommendations (one product on the left-hand side and one product on the right-hand side) from the Link Analysis node, but identifying next best recommendations for more complex rules is a far more manual process.

 

Association analysis at its core is a fairly manual process anyway since there are so many rules that are generated.  Scoring the data requires transposing the rules making each rule a new column in the scored data, so there are only a limited number of rules which can be actually transposed (200 maximum in the node itself). The decision which rules are of interest invariably relies on the business question of interest.   Given you are hoping to identify a recommendation for each person, you might consider the following strategy which although manual might be manageable depending on the number of products you might consider recommending.  

 

1 - Generate as many rules as possible by doing the following:

 

In the Association section of the property sheet...

   a. Increase the Maximum Items property to a larger number (e.g. 8 or 10)

   b.  Lower the Minimum Confidence Level property to 1

   c.  Lower the Support Percentage property to 1


In the Rules section of the property sheet, specify the largest possible values for "Number to Keep" in the Rules section of the property sheet for the Association node you are using.  Should the maximum number listed there be insufficient, I can tell you how to modify the properties to allow more.

 

2 - Run the flow.

 

3 - Identify where the full rules table is located in the SAS Enterprise Miner project (a possibly truncated version can be surfaced by viewing the results of the run and clicking on View --> Table.  To see the table in the project, proceed as follows:

   a. Click on the Association node of interest and note the value for the Node ID property (e.g. mine is Assoc2)   

   b. Click on the diagram name in the top left corner panel and note the ID property (e.g. mine is EMWS3)

   c. Click on the project name in the top left corner panel and note the project name and the Path property for the project (e.g. mine project is named MyExample and Path=C:\EM14proj )

   d. Navigate using your operating system tools to the data set

 

           < Path > \ < project name > \ Workspaces \ < diagram ID> \ <Node ID>_rules

 

       so for my example it would be

 

           C:\EM14proj\MyExample\Workspaces\EMWS3\assoc2_rules.sas7bdat

 

4 - Copy this file outside of the project and save it under a new name (e.g. RulesTable.sas7bdat), but do not modify the original file in the Workspaces folder as it might corrupt your diagram or project

 

5 - Run something similar to the following SAS code to identify which right-hand side (RHS) fields only contain one item:

 

    libname mylib 'C:\data';   * define path to where data is;

    data mylib.RHS;            * name for new data set;

       set mylib.RulesTable;     * name for data set copied from project folder;

        if index(_RHAND,'&') gt 0 then delete;  * remove rules with more than one item in RHS;

     run;

 

6 - Review the resulting rules and sort as desired by the available statistics in the data set such as expected confidence (EXP_CONF), confidence (CONF), support, lift, or count.   You will likely disqualify several rules that are of lesser interest in spite of these values.   

 

7 - You will likely need to write code to deploy your rules once you have chosen them.  

 

As I said, there is not an easy way to accomplish what you were hoping to do.   

I hope this helps!

Doug

Mila_das
Calcite | Level 5

I am looking for similar information and analysis.

 

1) Anomalous Commodity Bundling: Objective of my study is to find anomaly in terms of item bundling. Hence need to detect associations with lower threshold and compare with historical associations to flag them as anomaly with some confidence.

 

2)  I am trying to apply Link analysis node as throws out item clusters.  However I couldn't find option to change the maximum items property. The output of link analysis seems to only generate 2 item rules. Is there any work around?

 

3) Do you suggest to apply Association nodes instead? Any tips to compare multiple association rules across two set of results will be

 

Thanks,

Sharmila

 

 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1954 views
  • 1 like
  • 3 in conversation