BookmarkSubscribeRSS Feed
Jonison
Fluorite | Level 6

Hello, I would like to get a leave-one out prediction matrix.

 

I have a create a model and represented as a score-model. Next step is generate a leave-one out prediction matrix.

 

Have: scored model, j-dimension prediction data set.

 

1. i=1

2. drop jth row from prediction data set, the prediction dataset will be j-1

3. call scored model to get prediction results (j-1 dimension)

4. i+1

5. loop will be finished once i=j

 

A simple j=5 will be like this:

 

idx1…...xny1y2y3y4y5
1 n/ap21p31p41p51
2 p12n/ap32p42p52
3 p13p23n/ap43p53
4 p14p24p34n/ap54
5 p15p25p35p45n/a

 

*n/a means that row has been dropped for prediction, so no prediction available, but still should be included in the results table.

 

 

would you please help on this codes? really appreciated that if the results can be generated as matrix shown in table above? really apricated!

1 REPLY 1

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 Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 746 views
  • 0 likes
  • 2 in conversation