BookmarkSubscribeRSS Feed
NichelleT
Calcite | Level 5

Hi everyone,

Is there a way to set a seed for the cross validation statement in proc forest. I have already set a seed for the proc forest model and it states in the log that the cross validation is using the same seed. However I noticed that when I run the same model multiple times, the Cross-Validation Fit Statistics differs for each run.

2 REPLIES 2
Rick_SAS
SAS Super FREQ

Post your code and the log so we can see what kind of cross-validation you are using.

 

If you are using the PARTITION statement, you can set the seed there.

 

Some types of cross-validation do not use randomness. For example, you can put observations 1,6,11,16,... into one fold, observations 2,7,12,17,... into the second fold, etc. 

NichelleT
Calcite | Level 5

Hi Rick,

This is the code for the proc forest procedure with cross validation statement:

proc forest data=MODELINPUT seed=1854718772
maxdepth=29
ntree=100;
target tgt / level=interval;
input var1 var2 var3 var4 var5 var6 var7 var8 var9 / level=interval;
input var10 / level=nominal;
crossvalidation kfold=5;
run;

Also, I have attached a screenshot of the log.

log.PNG

Thank you!

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