Dear SAS community,
My issue: I am trying to upload a data file of type svm-light. I have attached an example of such a file (which I downloaded from the UCI Machine Learning Dataset). I would like to upload such a file into SAS but I am at a loss as to how to do this.
What I intend to do with the data set: I would like to analyze this dataset using GAM. I pretty sure the data is provided in this svm-light form because the data matrix is extremely sparse.
I googled this topic in various ways and could not find a solution. I sincerely apologize if this has already been solved, and I missed it.
Thank you in advance
Not sure what that data represents , but you could read it into a vertical table pretty easily.
I am not sure what the first column represents, since it seems to +/- in the front I will call it OFFSET.
The rest appear to be index:value pairs. You can read those by using space and colon as the delimiter.
data want ;
length row col value offset 8;
infile 'Day120.svm' dlm=' :' truncover lrecl=1000000 ;
input offset @ ;
row+1;
do until (col=.) ;
input col value @ ;
if col ne . then output;
end;
run;
Thank you very much Tom. I will give your solution a try very soon. And to your point, I should have elaborated on the data more. This data set is a 20000 x 3231961 matrix that categorizes websites as either benign or malicious. Each row represents a website and the +3 million columns describe website features.
Thank you again,
Gary
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.