# NOT RUN {
# load the model and data
plpData <- loadPlpData("plpdata/")
results <- PatientLevelPrediction::runEnsembleModel(population,
dataList = list(plpData, plpData),
modelList = list(model, model),
testSplit = "person",
testFraction = 0.2,
nfold = 3,
splitSeed = 1000,
ensembleStrategy = "stacked")
# use the same population settings as the model:
populationSettings <- plpModel$populationSettings
populationSettings$plpData <- plpData
population <- do.call(createStudyPopulation, populationSettings)
# get the prediction, please make sure the ensemble strategy for training and apply is the same:
prediction <- applyEnsembleModel(population,
dataList = list(plpData, plpData),
ensembleModel = results,
analysisId = NULL)$prediction
# }
Run the code above in your browser using DataLab