BookmarkSubscribeRSS Feed
yaoyao
Fluorite | Level 6

I'd like to build a tree model with cross-validation. I'd like to assign observations to different cross-validation groups by myself instead of random sampling. I am not sure how SAS can do this. It would be helpful if anybody can share some example SAS code. 

 

Many thanks in advance

1 REPLY 1
yaoyao
Fluorite | Level 6

Just add some details about my question. I have monthly time-series data. And I want to predict forward 3 months. So there are some overlapping periods when running cross-validation. For example, if Jan and Feb are in the training set and March in the testing set, the model might know what is likely to happen when using the training set due to the overlapped periods. Currently, I run sampling before building the tree model and assign group id for cross-validation. For example, assign Jan, Feb, and Mar as group 1 and Jun and Jul as group 2. Pass the group ID to the tree model function. I implement it in R. Not sure how SAS can do it.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 578 views
  • 0 likes
  • 1 in conversation