customer analytics with sas enterprise miner hands-on …...open customer analytics rpm.xlsx from...

40
Customer Analytics with SAS ® Enterprise Miner Hands-on Workshop SAS Australia and New Zealand V1.1

Upload: others

Post on 08-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

Customer Analytics with SAS® Enterprise Miner

Hands-on Workshop

SAS Australia and New Zealand V1.1

Page 2: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

2 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

1. An Introduction to Customer Analytics .......................................................................... 3

2. Predicting Outcomes for Targeted Decision Making ..................................................... 7

Demonstration: Who will take up a Personal Loan? .............................................................. 10

3. Segmenting the Database ............................................................................................. 28

Demonstration: What groups of customers are there? ........................................................... 30

Page 3: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

1 An Introduction to Customer Analytics 3

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

1. An Introduction to Customer Analytics

Page 4: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

4 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

Page 5: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

1 An Introduction to Customer Analytics 5

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

Page 6: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

6 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

Page 7: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

2 Predicting Outcomes for Targeted Decision Making 7

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

2. Predicting Outcomes for Targeted Decision Making

Page 8: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

8 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

Page 9: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

2 Predicting Outcomes for Targeted Decision Making 9

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

Page 10: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

10 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

Who will take up a Personal Loan?

1. Open Customer Analytics RPM.xlsx from D:\workshop\catour.

Before modelling, let’s first explore the data and understand the variables.

Page 11: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

2 Predicting Outcomes for Targeted Decision Making 11

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

Exploring data with SAS in Microsoft Excel

2. From the SAS ribbon, click Tasks and navigate to Describe and select Characterize Data…

3. Click OK.

4. Click Next>.

5. Uncheck SAS Data Sets.

Page 12: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

12 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

6. Click Next> then Finish.

7. Scroll through the output and answer these questions:

How many levels of Education are there?

What is the maximum for the variable “Cash” in this data set?

Personal _Loan_Flag is a binary variable. 1 indicates the customer has taken a loan, a 0

indicates the customer has not taken a loan. What percentage of customers have taken a loan?

Page 13: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

2 Predicting Outcomes for Targeted Decision Making 13

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

Predicting Personal Loan take-up

8. Go back to Sheet1 where the data is.

9. From the SAS ribbon click Tasks then navigate to Data Mining and select Rapid Predictive

Modeler

10. Click OK.

Page 14: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

14 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

11. In the Name panel, find Personal_Loan_Flag and drag the variable to Dependent variable.

12. On the left panel select Model, and click on the Intermediate Modeling method.

Page 15: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

2 Predicting Outcomes for Targeted Decision Making 15

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

13. On the left panel select Report, and check all available Report options.

14. On the left panel select Options and uncheck Save Enterprise Miner project data and Score input

data set. A pre-created SAS Enterprise Miner project already exists for the rest of this workshop.

15. Click Run.

Page 16: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

16 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

16. Scroll through the output in worksheet Rapid Predictive Modeler and answer these questions:

What percentage of customers have a personal loan?

How many nominal inputs are there?

What was the most important variable?

What is the roc index for validate?

Which was the selected model?

In the next section we will see the SAS Enterprise Miner project that was created by the Rapid

Predictive Modeler task.

Page 17: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

2 Predicting Outcomes for Targeted Decision Making 17

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

Predicting Personal Loan take-up in SAS Enterprise Miner

17. Open the SAS Enterprise Miner interface by either double-clicking on the SAS Enterprise Miner

Client 13.2 icon on the desktop or select Start All Programs SAS SAS Enterprise Miner

Client 13.2.

The SAS Enterprise Miner logon window appears.

Page 18: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

18 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

18. Select Log On.

Your user ID and password should be filled in for you. To access SAS Enterprise Miner,

click Log On.

19. Select Open Project….

Page 19: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

2 Predicting Outcomes for Targeted Decision Making 19

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

20. Select the catour project and then click OK.

The following window appears:

Page 20: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

20 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

21. To open the process flow that was just built by Rapid Predictive Modeler, expand Diagram in the

Project tree and double-click RM1 – Personal_Loan_Flag.

Navigate the diagram and view the results of some of the nodes. To open the results of each node, right-

click on the node and select Results.

Page 21: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

2 Predicting Outcomes for Targeted Decision Making 21

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

22. Go to the far right of the process flow and open the results of the Model Comparison by right-

clicking the node and select Results…

Which model was chosen as the “best” model by the Model Comparison node?

Page 22: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

22 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

23. View the results of the Decision Tree (2) node by right-clicking the node and selecting Results…

24. Maximise the tree panel in the top right corner.

What is the primary variable for differentiating those who will take-up the personal loan offer and those

who will not?

Page 23: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

2 Predicting Outcomes for Targeted Decision Making 23

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

25. Add a Neural Network node from the Model tab at the top of the diagram. Drag the node to a blank

space on the diagram.

26. Connect the node from the Metadata node to the Model Comparison node. This can be done by

moving the mouse to the right side of the Metadata node until the pencil appears and then drag and

drop the pencil to the Neural Network node and repeat from the Neural Network node to the Model

Comparison node.

Page 24: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

24 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

27. Click on the Model Comparison node, and change the Selection Statistic to Average Squared

Error.

28. To run all unexecuted nodes prior to the Model Comparison node and update results based on

changes, right-click the Model Comparison node and select Run. Select Yes in the pop-up window.

Note that the nodes run concurrently.

Page 25: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

2 Predicting Outcomes for Targeted Decision Making 25

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

29. Click Results when the node finishes running.

Which model is now chosen as the “best” model by the Model Comparison node?

30. Expand Data Sources in the project tree and drag BANK_CREDITCARDS_Score to a blank area

on the right of the diagram. This is another table of similar structure that will be scored against the

best model. “Scoring” is the process by which the modelling logic is applied to data (the population

or new data) to derive prediction scores.

Page 26: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

26 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

31. Connect the score data to the Score node.

32. Right-click the Score node and select Run then Yes.

33. Click OK.

34. With the Score node selected in the diagram, click the ellipsis next to Exported Data in the Properties

panel.

Page 27: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

2 Predicting Outcomes for Targeted Decision Making 27

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

35. Select the Score data, and click Browse.

What new variables are created by the scoring process?

Page 28: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

28 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

3. Segmenting the Database

Page 29: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

3 Segmenting the Database 29

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

Page 30: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

30 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

What groups of customers are there?

36. Create a new diagram by right-clicking on diagram and select Create Diagram.

37. Enter “Segmentation” as the diagram name, and press OK

Page 31: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

3 Segmenting the Database 31

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

38. Select BANK_CREDITCARDS_SEGMENTATION from Data Sources and drag this to the

Segmentation diagram. This data has fewer variables than the previous tables.

39. Right-click the data node in the diagram and select Edit Variables…

Page 32: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

32 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

40. Use the CTRL or SHIFT key to select all available variables and click Explore…

Page 33: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

3 Segmenting the Database 33

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

41. In the PERSONAL_LOAN_FLAG chart, click the bar with value 1 – those with a positive outcome –

and view the brush effect across the other charts.

There seems to be a relationship between whether a customer takes up a personal loan and some

demographic attributes.

42. Drag the Transform Variables node from the Modify tab to the diagram and connect it to the data

node.

Page 34: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

34 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

43. With the Transform Variables node selected, go to the Properties panel on the left and change the

following properties:

Interval Inputs to Maximum Normal. This technique automatically determines the best

transformation to normalize continuous input variables.

Hide under Score to No.

44. Drag a Cluster node from the Explore tab to the diagram and connect it to the Transform Variables

node.

Page 35: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

3 Segmenting the Database 35

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

45. With the Cluster node selected, go to the Properties panel on the left and options under Number of

Clusters and change the following:

Specification Method to User Specify.

Maximum Number of Clusters to 5.

46. Run the Cluster node.

Page 36: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

36 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

47. Click Results...

5 clusters are created. Clusters 4 and 5 are the largest and cluster 2 is the smallest. Statistics for each

cluster can be seen in Mean Statistics.

48. Maximise the Segment Plot. This gives a profile of each cluster by each input variable.

Page 37: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

3 Segmenting the Database 37

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

49. Drag a Segment Profile node from the Assess tab to the diagram and connect it to the Cluster node.

This is an alternative way of profiling clusters using the same inputs or different inputs.

50. With the Segment Profile node selected, go to the Properties panel on the left and change the

following properties:

Number of midpoints to 16.

Analysis Role under Target Variables to Report.

Page 38: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

38 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

51. To profile with the original variables rather than the transformed variables, right-click the Segment

Profile node and select Edit Variables…

52. Change the value of Use for variables with prefix SQRT to No.

53. Change the value of Use for the original variables to Yes.

Page 39: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

3 Segmenting the Database 39

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

54. Run the Segment Profile node and click Results…

55. Maximise the Profile: _SEGMENT_ window.

Each row represents a cluster from largest at the top to smallest at the bottom.

Page 40: Customer Analytics with SAS Enterprise Miner Hands-on …...Open Customer Analytics RPM.xlsx from D:\workshop\catour. Before modelling, let’s first explore the data and understand

40 Customer Analytics with SAS® Enterprise Miner Hands-on Workshop

Copyright © 2015, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED.

The sections from left to right describe the most important variables to differentiate each cluster in

descending order. Example, Number of children is the most important variables to describe Segment 5

followed by gender, etc. For interval variables, the red outline is population distribution and the blue bars

are the segment distribution. For categorical variables, the inner pie chart is the population breakdown

and the outer ring is the segment breakdown.

56. Answer these questions:

What type of customers are in Segment 5?

What type of customers are in Segment 4?

Between Segments 4 and 5, which one is more likely to respond to a Personal Loan offer?

What segment is the least likely to respond to a Personal Loan offer?