Hi All,
I'm trying to run KNN on set of standardized inputs and identify 20 neighbors using Euclidean distance or other similar distance.
I would like to get top N neighbor, distance between the neighbors and my item as output. I don't have a target variable in my dataset, so I need this procedure to identify my neighbors based only on input space. I have 21K items and 145 variables in my dataset, so I'm also looking for efficiency of the procedure.
I tried MBR node in Enterprise miner and PROC DISCRIM in base SAS, but both requires target variable.
Can anyone kindly point me to the right procedure that would be helpful to implement my problem. Let me know if any other details are needed.
Thanks in advance
Regards,
Shan
Try using proc modeclus with options neighbor and dk=
ods _all_ close;
proc modeclus data=myData dk=21 neighbor;
var var1-var145;
id Item;
ods output Neighbor=myNeighbors;
run;
ods listing;
test with a subset first!
Try: Proc Cluster, Aceclus and Fastclus
Thanks for quick reply. I will take a look into these procedure, run it on my data and will let you know the results.
Try using proc modeclus with options neighbor and dk=
ods _all_ close;
proc modeclus data=myData dk=21 neighbor;
var var1-var145;
id Item;
ods output Neighbor=myNeighbors;
run;
ods listing;
test with a subset first!
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 the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.