BookmarkSubscribeRSS Feed
filbert2021
Calcite | Level 5

Hi, I have an enquiry on how to generate confusion matrix in SAS Enterprise Miner?

 

I am interested in calculating Precision, Recall and F1 Score of my model but I can't find it anywhere on EM.

 

Thank you.

- Filbert

3 REPLIES 3
sbxkoenk
SAS Super FREQ

Hello,

 

I had a nice program for that , but lost it due to our document retention policy.

I had forgotten to label it for "more than x-year preservation".

 

But in fact, it's easy.

Suppose your (binary) target variable is named "BM".

Then submit this code :

proc freq data=my_dataset;
 tables F_BM * I_BM / missing list out=work.ConfusionMatrix;
run;

... and calculate all your wished for metrics from there using a datastep with retain statement.

 

But only the F1-score needs to be calculated , if I remember well.

All other metrics are given by Enterprise Miner already.

 

Remember this :

  • In binary classification, recall is called sensitivity.
    Recall is also known as True Positive Rate (TPR), probability of detection, hit rate.
  • Precision = Positive Predictive Value (PPV)

 

See also : https://en.wikipedia.org/wiki/Precision_and_recall

 

Cheers,

Koen

filbert2021
Calcite | Level 5
Hi Koen,

Thank you for your prompt reply.

For the existing metric given by Enterprise Miner like precision and recall. How do I access this information?

I can't seem to find it at my model outputs.

- Filbert
sbxkoenk
SAS Super FREQ

Hello,

 

In your diagram, add the Cutoff node from the Assess group.

Run it and open the Results.
"View" pull-down menu --> Classification Rates

"View" pull-down menu --> Precision Rates

 

Koen

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1309 views
  • 0 likes
  • 2 in conversation