Create the test fold data for validation

createTestDataFold(data, trainData, id = getOption("latrend.id"))

Arguments

data

A data.frame representing the complete dataset.

trainData

A data.frame representing the training data, which should be a subset of data.

id

The trajectory identifier variable.

See also

createTrainDataFolds

Other validation methods: createTestDataFolds(), createTrainDataFolds(), latrendBoot(), latrendCV(), lcModel-data-filters

Examples

data(latrendData)

if (require("caret")) {
  trainDataList <- createTrainDataFolds(latrendData, id = "Id", folds = 10)
  testData1 <- createTestDataFold(latrendData, trainDataList[[1]], id = "Id")
}
#> Loading required package: caret
#> Loading required package: lattice
#> 
#> Attaching package: ‘caret’
#> The following object is masked from ‘package:latrend’:
#> 
#>     confusionMatrix