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

partitioning data by a nominal variable

Accepted Solution Solved
Reply
Contributor
Posts: 28
Accepted Solution

partitioning data by a nominal variable

The partition mode in EM lets one split up a data set into training, validation, and test data sets base on random sampling. However, I want to partition my data by the values in a variable I call datset: 'D', 'V', 'T'. How can I achieve this using EM? Thanks! Andrew
Andrew A. Kramer, PhD
President
Prescient Healthcare Consulting

Accepted Solutions
Solution
‎07-26-2016 01:22 PM
SAS Super FREQ
Posts: 306

Re: partitioning data by a nominal variable

Posted in reply to DocMartin

You can do it with a SAS Code node with the following code:

 

 

data &EM_EXPORT_TRAIN &EM_EXPORT_VALIDATE &EM_EXPORT_TEST;
   set /* your data */;
   if datset='D' then output &em_export_train;
   else if datset='V' then output &em_export_validate;
   else if datset='T' then output &em_export_test;
drop datset; run;

 

 

View solution in original post


All Replies
Solution
‎07-26-2016 01:22 PM
SAS Super FREQ
Posts: 306

Re: partitioning data by a nominal variable

Posted in reply to DocMartin

You can do it with a SAS Code node with the following code:

 

 

data &EM_EXPORT_TRAIN &EM_EXPORT_VALIDATE &EM_EXPORT_TEST;
   set /* your data */;
   if datset='D' then output &em_export_train;
   else if datset='V' then output &em_export_validate;
   else if datset='T' then output &em_export_test;
drop datset; run;

 

 

☑ This topic is solved.

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

Discussion stats
  • 1 reply
  • 267 views
  • 0 likes
  • 2 in conversation