I am importing a dataset in Enterprise Miner which contains interval values. However, all the decimal points is formatted using ',' as opposed to '.', e.g. "42,0", so it could not accept it as interval. Is there a way to change the formatting of the decimals to '.' and change the nominal to interval variables for all the columns that has this problem?
I have the example dataset attached.
Edit:
I have tried using the SAS code node and inputted this code:
data &EM_EXPORT_TRAIN;
set &EM_IMPORT_DATA;
array vars [*] _character_;
do i = 1 to dim(vars);
vars[i] = compress(tranwrd(vars[i],"a","X"));
end;
drop i;
run;
It changed all the ',' to '.', however I still do not know how to proceed as the next step shows error and the supposedly numerical variables are still counted as nominal.
Hello,
I can give you the EM code node way to do this, but why aren't you doing this in the normal SAS editor BEFORE "uploading" (importing) the dataset to Enterprise Miner?
That's way more straightforward. (In EM there's additionally the metadata role that you have to change.)
[EDIT] Sorry, not the role --> the measurement scale
Good luck,
Koen
You will have to make new variables and drop the old ones !
With below code :
(but if you want the code to automatically convert hundreds of character variables, you will have to make this dynamic and data driven) :
data temp(drop=old);
old = '1,61';
new = input(old,commax5.);
run;
If you do not succeed in doing this in an efficient way (with only a few lines of code for all hundreds of character variables), I will put a program here in the weekend !
Koen
Ah OK. Glad it is solved !
Sorry, I forgot about this question in the past two weeks.
Do not let it deter you from asking more questions on this data science (or other) board(s).
Thanks,
Koen
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.