[R] calibration/validation sets
andy_liaw at merck.com
Sun Aug 15 03:05:22 CEST 2004
There are many ways to do this. One example, supposing your data is in
## randomly pick 1/3 for validation:
valid.idx <- sample(nrow(myData), round(nrow(myData)/3), replace=FALSE)
## training set:
myData.tr <- myData[-valid.idx,]
## validation set:
myData.valid <- myData[valid.idx,]
> From: Peyuco Porras Porras .
> Does anyone know how to create a calibration and validation
> set from a particular dataset? I have a dataframe with nearly
> 20,000 rows! and I would like to select (randomly) a subset
> from the original dataset (...I found how to do that) to use
> as calibration set. However, I don't know how to remove this
> "calibration" set from the original dataframe in order to get
> my "validation" set.....Any hint will be greatly appreciated.
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide!
More information about the R-help