BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mmaccora
Obsidian | Level 7

Hi,

My question is the following:

Consider a data set where we have 2 variables called "Fruit" and another one called "CFruit" with corresponding codes.

Ex:
Variable "Fruit": lemon, orange, melon, banana, lemon etc.
Code Variable for Fruit "CFruit": 1, 7, 3, 5, 1, etc.

So that, 1 = lemon, 7 = orange, 3 = melon, 5 = banana, etc.

In SAS Enterprise Miner, is it possible to use the "CFruit" variable as input to train a model (for instance a decision tree), but display the corresponding labeled variable "Fruit" ?

In fact, it is easier for me to interpret the model with labels instead of codes, but for implementing the process in an automated chain it is more convenient and secured to use codes.

Thank you very much for your help.

Best Regards,
Marco

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Create a format and apply the format to the variable in the SAS data set. 

It should operate as you desire. It's probably easier to do that in your prep step, which I find easier outside of EM. 

View solution in original post

3 REPLIES 3
Reeza
Super User

Create a format and apply the format to the variable in the SAS data set. 

It should operate as you desire. It's probably easier to do that in your prep step, which I find easier outside of EM. 

mmaccora
Obsidian | Level 7
Thank you very mich for your answer it works!

Is it possible now to bypass the hard coded format ?

What I would like is to based my format on another column "one-to-one":

Dataset:
1, lemon
7, orange
3, melon
5, banana
1, lemon

A code like:

proc format;
value $LabelFruit.
CFruit = Fruit;
run;

Do you know a way of doing such kind of formatting ?
Reeza
Super User

When in doubt check the documentation, especially the examples. 

 

http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#n1e19y6lrektafn1kj6nb...

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 861 views
  • 0 likes
  • 2 in conversation