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

Interval & Nominal Variables

Accepted Solution Solved
Reply
Contributor
Posts: 52
Accepted Solution

Interval & Nominal Variables

When a dataset is read in SAS the varaibles are classifies as numeric in character . While SAS Enterprise miner classifies them as nominal & interval . Can some one tell me how is it done in Miner(the logic) & how it can be achieved using SAS Enterprise Guide? 


Accepted Solutions
Solution
‎07-28-2017 04:44 PM
SAS Super FREQ
Posts: 328

Re: Interval & Nominal Variables

For your first question, when using the "Basic Advisor" in Enterprise Miner, it is just assigning numeric variables to Interval and character variables to Nominal.  With the "Advanced Advisor", the assignment for numeric variables is based on the number of levels the user specifies (20 by default, so numeric variables with < 20 levels would be set to Nominal and >=20 would be Interval).

View solution in original post


All Replies
Solution
‎07-28-2017 04:44 PM
SAS Super FREQ
Posts: 328

Re: Interval & Nominal Variables

For your first question, when using the "Basic Advisor" in Enterprise Miner, it is just assigning numeric variables to Interval and character variables to Nominal.  With the "Advanced Advisor", the assignment for numeric variables is based on the number of levels the user specifies (20 by default, so numeric variables with < 20 levels would be set to Nominal and >=20 would be Interval).

Occasional Contributor pa4
Occasional Contributor
Posts: 6

Re: Interval & Nominal Variables

Posted in reply to WendyCzika

Hi I am still same issue. 

 

My all interval variables in dataset is read by SAS EM as nominal & i am unable to change it. 

I am not using advanced advisor . I also tried metadata node from utility tab but still its reading them as Nominal. 

 

This is happening in file import node as well as when i tried to save csv file as SAS dataset. 

 

Any help would be great !! 

 

Thanks , 

PA4

SAS Employee
Posts: 214

Re: Interval & Nominal Variables

Make sure that you check whether the variables in question have any non-numeric data and/or have a non-numeric format.    One of the fastest ways to check is to run the CONTENTS procedure against your data set and see how it is being read.   Data that is exported to text formats often have extremely long lengths attached to them depending on the source of the data.   Depending on how big the data set it is, you might consider trying to import it into SAS Enterprise Guide, but you issue more than likely has to do with non-character data and/or formats.   You will typically find it easier reading in a SAS data table.  

 

If you run the CONTENTS procedure, look for character formats/informats.   It is easy to remove formats/informats with a data step like the following:

 

data new_data;

    set old_data;

    format _all_;

    informat _all_;

run;

 

You can also just remove the offending formats from the variables in question in place of using _all_ to remove all of them.  The formatting of numeric variables should not matter anyway since it is just for display, but you must remove any character formats which is most likely the cause of the problem.

 

Hope this helps!

Doug

SAS Employee
Posts: 74

Re: Interval & Nominal Variables

What is your goal in Enterprise Guide? This will determine what you need to do.
Contributor
Posts: 52

Re: Interval & Nominal Variables

Posted in reply to MelodieRush

Hi Melodie ,

 

Thanks for your reply. I need to run a random forest in EG & that requires the nominal & interval variables to be specified using the HPForest:

 

PROC HPFOREST data=testdata maxtrees=100;
target Ind/level=binary;
input &nom_vars/level=nominal;
input &int_var /level=interval;
run;

 

I know in Miner its a lot easier but I want to replicate the same thing using EG.

 

Thanks again!!

SAS Employee
Posts: 214

Re: Interval & Nominal Variables

It seems you have already answered your own question. You would need to assign the variables to the nominal and interval level based on the number of levels. You could use the FREQ procedure to determine the number and nature of levels. Please help me understand what is not working if you are still having difficulty! Thx, D
☑ This topic is solved.

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

Discussion stats
  • 6 replies
  • 1693 views
  • 0 likes
  • 5 in conversation