Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Visual Data Mining and Machine Learning or just with programming

Decision Tree

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 8
Accepted Solution

Decision Tree

Hi,

I am trying to build interactive Decision Tree using SAS EM 6.2. The tree takes only 20,000 records for building the tree while my dataset contains over 100,000 records.

Can anyone please suggest how can I make the tree take my complete records in consideration to build the tree? I am stuck at this point.

Thanks,

Nikhil


Accepted Solutions
Solution
‎07-07-2017 01:54 PM
SAS Employee
Posts: 31

Decision Tree

[ Edited ]

Some users may wish to override default Enterprise Miner interactive decision tree sampling strategies. Enterprise Miner provides two macros that you can issue with your project startup code that will modify interactive decision tree input data sampling behaviors:

%let EM_INTERACTIVE_TREE_MAXOBS= <max-number-of-observations-in-sample>;
%let EM_INTERACTIVE_TREE_SAMPLEMETHOD=<RANDOM | FIRSTN>;

The first macro specifies the maximum number of observations that can exist in an Interactive Decision Tree node sample. You use this macro if you want to manually control the sample size. Otherwise, Enterprise Miner will use its own algorithms to perform sampling for your interactive decision tree.

The second macro specifies the sampling methodology that will be used to create an Interactive Decision Tree node sample. You can use this macro if you want to manually control the methodology Enterprise Miner uses to create interactive decision tree samples. By default, Enterprise Miner uses random sampling for interactive decision trees. You can use the macro to choose between RANDOM and FIRSTN sample creation. You use the EM_INTERACTIVE_TREE_MAXOBS macro to specify the number of observations for both RANDOM and FIRSTN sampling strategies.

View solution in original post


All Replies
PROC Star
Posts: 7,357

Decision Tree

Could it simply be that you or the algorithm selected a particular size for a training model?

Solution
‎07-07-2017 01:54 PM
SAS Employee
Posts: 31

Decision Tree

[ Edited ]

Some users may wish to override default Enterprise Miner interactive decision tree sampling strategies. Enterprise Miner provides two macros that you can issue with your project startup code that will modify interactive decision tree input data sampling behaviors:

%let EM_INTERACTIVE_TREE_MAXOBS= <max-number-of-observations-in-sample>;
%let EM_INTERACTIVE_TREE_SAMPLEMETHOD=<RANDOM | FIRSTN>;

The first macro specifies the maximum number of observations that can exist in an Interactive Decision Tree node sample. You use this macro if you want to manually control the sample size. Otherwise, Enterprise Miner will use its own algorithms to perform sampling for your interactive decision tree.

The second macro specifies the sampling methodology that will be used to create an Interactive Decision Tree node sample. You can use this macro if you want to manually control the methodology Enterprise Miner uses to create interactive decision tree samples. By default, Enterprise Miner uses random sampling for interactive decision trees. You can use the macro to choose between RANDOM and FIRSTN sample creation. You use the EM_INTERACTIVE_TREE_MAXOBS macro to specify the number of observations for both RANDOM and FIRSTN sampling strategies.

Occasional Contributor
Posts: 8

Decision Tree

Hi Wayne,

Thanks for the help. But I am new to EM. Request you to please guide me how can I update the project startup code.

Thanks,

Nikhil

Occasional Contributor
Posts: 8

Decision Tree

Hi Wayne,

Thanks a lot. I figured out how to update startup code. I need one more help.

When I run the interactive decision tree Prediction value is shown as 0. How can I change it to prediction = 1?

Thanks,

Nikhil

SAS Employee
Posts: 31

Decision Tree

Hi Nikhil,

My fault but I probably and not understanding the question well.

When you run similar startup code for the project:

%let EM_INTERACTIVE_TREE_MAXOBS=100000;

%let EM_INTERACTIVE_TREE_SAMPLEMETHOD=RANDOM;

And you are modeling a binary response, do you have 1's and 0's  distributed in the root node?

Is your target variable indeed a binary target and set to the binary variable role in the input node or is it set as interval? 

Thanks

Occasional Contributor
Posts: 8

Decision Tree

I am sorry Wayne. I should have been more clear.

The whole picture is:

I have got a project to build a logistic regression model (Binary Response). So, my target variable is binary and explanatory variables are interval as well as binary.

Now the problem is I want to build a decision tree to get an idea which set of variables can I use to build some new variables to include in the predictive model. So, my root node is distributed as binary and my input nodes are binary as well as interval. But when I am building the tree it is showing prediction = 0 as the target. I want it to change to prediction = 1. So, need your help on this.

Thanks,

Nikhil

Occasional Contributor
Posts: 8

Decision Tree

I also mentioned the order as descending for my target variable where I define the role of each variable.

SAS Employee
Posts: 31

Decision Tree

Prediction=0 in the table refers to the prediction for the selected node. Assuming you are strating with the root node and  and  you have more 0s than 1s then the prediction classification for the root node is =0.   When you split on the root node and continue growing the tree interactivelhy hopefully you are resulting in some nodes (leaves) with prediciton = 1. 

In some cases when you have a rare target event (1s) and little if any signal in the data the null root node can result in being the final classification. In this case trying using the inverse priors options under "Decisions" for the Input Data Source node.    Or obtain add some additonal predictors if you avaialble.  Anyway I could still be of base with your question. Hope this helps.

Occasional Contributor
Posts: 8

Decision Tree

Thanks a lot for the input Wayne. It helped me a lot. I will touch base with you in case of any futher help..

Thanks a lot again.

Nikhil

Occasional Contributor
Posts: 8

Decision Tree

Hi,

I have come across a situation where I need to use cluster analysis in SAS EM 6.2. I have run the clster analysis on the dataset but am unable interpret the output. Please help.

N/A
Posts: 1

Re: Decision Tree

Hi Nikhil,

I am new to EM too....How did you update the project startup code?

I want to run the classification tree onmy entire data set.

Regards,

Geetika

N/A
Posts: 1

Re: Decision Tree

Answer from SAS:

http://support.sas.com/kb/47/220.html

clip_image002.jpg

Regards,
Debbie

Occasional Contributor
Posts: 7

Re: Decision Tree

[ Edited ]

Hello Debbielu,

I did this, I put %let EM_INTERACTIVE_TREE_MAXOBS= 10000000; in the code, but it didn't work Smiley Sad I don't know what to do. Could you please explain me step by step telling what I have to do.

Thanks!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 13 replies
  • 4532 views
  • 0 likes
  • 6 in conversation