Leave Group out Cross Validation and datapoint tagging in R

Hi All,

I am new to machine learning using the R language.

I am developing a random forest regression ML model

I have assigned my dataset to groups using a float number and want to use that column in my dataframe as the the groups for leave group out cross validation (LGOCV). One group is left as the testing data and the remaining groups are the training data. I found out that the LGOCV can be used in the trainControl function but how do I assign my desired groups?

Also I wanna use an identification text for each (feature_target) pair (which I have) so that they are not used for machine learning but used as a tag for identifying and plotting etc.

I looked online but couldn't find a solution so far. I will be grateful for any code with example or online links of code. Thank you!!

Did you use cut() to make a discrete distribution out of a continuous variable (float)?

1 Like

Thanks for the reply. I have not done that but I can do that. Could you tell me how to assign my desired groups after doing that.

Sorry I missed this, look at help for cut(), it's all there

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.