BookmarkSubscribeRSS Feed
jaycette
Calcite | Level 5

Hi,

 

I am trying to make a decision tree that has several interval variables. Some of these variables have entries = 0, but that isn't the correct value - the 0's indicate missing or unknown values. I was wondering if there's a way I can tell SAS to interpret the 0's as missing values when it's making the decision tree?

 

Thanks,

 

1 REPLY 1
MelodieRush
SAS Employee

There are several ways this can be accomplished. The one I think that gives you the most control is to use the replacement node to replace the "0" with missing. I will attach the following flow in .xml format using the sample DMEXA1. (Link to video on importing the .xml file into Enterprise Miner)

 

2018-11-13_13-53-21.png

 

Once you have the replacement node you can choose what values you want to replace with a missing value. I used the Apparel variable to create this example. Here I set it up to replace all the "0"s with missing. 

 

Click on the replacement node, then click on the property under Interval Variables for the Replacement Editor

 

2018-11-13_13-55-59.png

 

When the editor opens, click on Apparel variable. Set Limit Method to User Specified, Fill in the values or use the interactive graph to select. This variable has integer values from 0 to 25. Set the Replace Method to Missing and then fill in the Lower Replacement Value & Upper Replacement Values.

 

2018-11-13_13-56-45.png

 

I then added an HP Explore to see the results of the replacement node and also a decision tree node. I used the interactive property on the decision tree node to build a tree with Apparel to see that I get the behavior I expected. 

 

2018-11-13_14-02-53.png

 

Here is the decision tree I created in interactive decision tree by using split on the rep_apparel variable.

 

2018-11-13_13-51-59.png

 

This should help you create what you want. Good luck.

 

Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF



SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 692 views
  • 0 likes
  • 2 in conversation