BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
a_bloch
Calcite | Level 5

Good afternoon,

I am looking for the AUC value (Area Under the Curve or ROC Index) in SAS Enterprise Miner in SAS 9.3. I have explored all the options from the ROC curve graph (see pic) and from the nodes I am using (logistic regression, decision trees and neural nets) without any success.


Many thanks in advance.

Capture.JPG

 

1 ACCEPTED SOLUTION

Accepted Solutions
WendyCzika
SAS Employee

You need to attach a Model Comparison node to the modeling node(s) that you are running, then in the Results for Model Comparison, if you look in the Statistics Comparison table, the row where Fit Statistics="_AUR_" corresponds to the area under the ROC curve.  The KS statistic is reported in that table as well.

Hope that helps!

View solution in original post

3 REPLIES 3
Quentin
Super User

I'm don't use Enterprise Miner but I've calculated AUC using PROC LOGISTIC.  It looks like EM is generating SAS code in the background perhaps (similar to DI studio?).  If so, is there somwhere you can see PROC LOGISTIC code which you would be able to edit by hand?  Can you show the current PROC LOGISTIC code?

 

You would want to insert a ROC statement within the PROC LOGISTIC step. 

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
rayIII
SAS Employee

Hi. You could compute AUC from the dataset that EM uses to display the ROC chart in the Model Comparison node. 

 

Here's some basic code that uses the formula for the area of a trapezoid. Put it in a SAS Code node after your Model Comparison node and run it.  (disclaimer:  untested code.)

 

The code assumes you have a single model (i.e., just one modeling node is hooked up to the Model Compare node) and that the nodeID of your model comparison is 'MdlComp'. 

 

data roc;
retain AUC ;
set &em_lib..mdlcomp_emroc (where=(model ne " _Baseline_"));
avgHeight = (sensitivity + lag1(sensitivity)) / 2;
width = oneminusspecificity - lag1(oneminusspecificity);
smallArea = avgHeight * width;
AUC + smallArea;
run;

 

*last row contains (total) AUC;
proc print data = roc;
var sensitivity avgHeight width oneMinusSpecificity smallArea AUC;
run;

 

Hope this helps.

 

Ray

WendyCzika
SAS Employee

You need to attach a Model Comparison node to the modeling node(s) that you are running, then in the Results for Model Comparison, if you look in the Statistics Comparison table, the row where Fit Statistics="_AUR_" corresponds to the area under the ROC curve.  The KS statistic is reported in that table as well.

Hope that helps!

sas-innovate-2024.png

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.

 

Register now!

How to choose a machine learning algorithm

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.

Discussion stats
  • 3 replies
  • 12770 views
  • 2 likes
  • 4 in conversation