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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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