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

How to Predict Categorical Target Variable using Decision Tree

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

How to Predict Categorical Target Variable using Decision Tree

Hi,

 

I would like to know How to Predict Categorical Target Variable using Decision Tree. 

 

 

Thank You.

Regards,

Ng Jian Wei


Accepted Solutions
Solution
‎08-14-2016 11:34 PM
SAS Employee
Posts: 106

Re: How to Predict Categorical Target Variable using Decision Tree

[ Edited ]

It's straightforward with Enterprise Miner and you can try this out by using the Fisher-Anderson Iris data, which is provided as a sample dataset: 

 

1. In Help > Generate Sample Data Sources, choose the iris data and press OK.

 

2. Drag the Iris data onto the canvas. 

 

3 Make sure Species is defined as a nominal target. (Confirm by right clicking on the node and choose Edit Variables...)

 

4. Connect it to a Decision Tree node and run. You will get a tree whose terminal nodes essentially correspond to different species (setosa, virginica, versicolor). 

 

In actual practice you would normally partition the data into training and validation samples before running the tree. You can use the Data Partition node for that.  

 

You can also look at the HP Tree node for distributed processing. 

 

Hope this helps. 

 

 

(note: edited for clarity)

 

 

 

 

View solution in original post


All Replies
Solution
‎08-14-2016 11:34 PM
SAS Employee
Posts: 106

Re: How to Predict Categorical Target Variable using Decision Tree

[ Edited ]

It's straightforward with Enterprise Miner and you can try this out by using the Fisher-Anderson Iris data, which is provided as a sample dataset: 

 

1. In Help > Generate Sample Data Sources, choose the iris data and press OK.

 

2. Drag the Iris data onto the canvas. 

 

3 Make sure Species is defined as a nominal target. (Confirm by right clicking on the node and choose Edit Variables...)

 

4. Connect it to a Decision Tree node and run. You will get a tree whose terminal nodes essentially correspond to different species (setosa, virginica, versicolor). 

 

In actual practice you would normally partition the data into training and validation samples before running the tree. You can use the Data Partition node for that.  

 

You can also look at the HP Tree node for distributed processing. 

 

Hope this helps. 

 

 

(note: edited for clarity)

 

 

 

 

New Contributor
Posts: 3

Re: How to Predict Categorical Target Variable using Decision Tree

Hi Raylll,

 

Thank you very much! Smiley Happy

SAS Employee
Posts: 106

Re: How to Predict Categorical Target Variable using Decision Tree

You're welcome!

☑ This topic is solved.

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

Discussion stats
  • 3 replies
  • 426 views
  • 0 likes
  • 2 in conversation