I'm trying to plot a dendrogram in SAS miner by SAS Code node using output of Cluster node and here's my code:
%em_register(key=Example, type=Data);
data &em_user_Example;
set &em_import_data;
run;
%em_report(key=Example, viewtype=DENDROGRAM, autodisplay=Y,
block=Dendrogram, name=_Name_, parent=_Parent_, height=_Varexp_);
it runs but it shows an error in the dendrogram window: "data is not assigned correctly".
can anyone help?
Thanks in advance.
I think you need to use a different data set - this code was using the training data, which doesn't have the needed variables.. And different variables as well.
This worked for me after a Cluster node (though I'm not sure if I'm using the correct variable for Height):
%em_register(key=Example, type=Data);
data &em_user_Example;
set &em_lib..clus_tree_plot;
run;
%em_report(key=Example, viewtype=DENDROGRAM, autodisplay=Y,
block=Dendrogram, name=Node, parent=Parent, height=LinkWidth);
this is the exported data from Cluster node.
how do I create tree data to export it to the SAS Code node?
The Cluster node creates that data set. If you look in the Explorer window in Enterprise Miner, click on the Show Project Data checkbox, and go into the EmwsZ library that corresponds to your diagram. All the Clus_ data sets are the ones created by the Cluster node (if you have multiple Cluster nodes, then the prefix will be something like Clus2_), including the Clus_tree_plot data set that I think is the one you want to use for the dendrogram.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.