View source: R/PartitionTrainAndPredict.R
Partitions the study sample, fits the model and makes predictions with SuperLearner.
1 2 3 4 | PartitionTrainAndPredict(study.sample,
outcome.variable.name = "composite", model.names = c("ModelGAP",
"ModelGerdin", "ModelKTS", "ModelRTS"), n.partitions = 2,
save.to.results = TRUE, verbose = FALSE)
|
study.sample |
Data frame. The study.sample. No default. |
outcome.variable.name |
Character vector of length 1. The name of the outcome variable of interest. Defaults to "s30d". |
n.partitions |
Numeric vector of length 1. The number of partitions to create with PartitionSample. Accepted values are 2 or 3. If 2, a train and test set is created. If 3, train, validation, and test sets are created - the models is fitted on the training set, optimal breaks is gridsearched on the validation set, and the model is tested on the test set. Defaults to 2. |
save.to.results |
Logical. If TRUE SuperLearner predictions, outcome and tc in each partition is saved to the Results list. Defaults to TRUE. |
verbose |
Logical. If TRUE the modelling process is printed to console. Defaults to FALSE. |
models.names |
Character vector. The model names to stack in SuperLearner. Defaults to c("SL.gam", "SL.randomForest", "SL.nnet, SL.xgboost", "SL.svm") |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.