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

How do I use a variable to specify training and validation datasets in SAS Enterprise Miner?

Reply
SAS Employee
Posts: 67

How do I use a variable to specify training and validation datasets in SAS Enterprise Miner?

[ Edited ]

This question has come up several times recently so with the help of Mike Stockstill in Tech support I wrote up the answer and published on LinkedIn and wanted to share it here as well.

 

The actual question I got was about how to use a date to specify training and validation datasets, so I address that at the end of my response.

 

LinkedIn Article: How to setup out of time hold out sample in SAS Enterprise Miner

 

The quick answer is to use the Code Node and put the following code in the Train Section

 

data &EM_EXPORT_TRAIN &EM_EXPORT_VALIDATE &EM_EXPORT_TEST;
set &EM_IMPORT_DATA;
if partition_key=1 then output &EM_EXPORT_TRAIN;
else if partition_key=2 then output &EM_EXPORT_VALIDATE;
else if partition_key=3 then output &EM_EXPORT_TEST;
run;

 

Ask a Question
Discussion stats
  • 0 replies
  • 281 views
  • 3 likes
  • 1 in conversation