ensemblePredict {FRESA.CAD} | R Documentation |
The median prediction from a list of models
Description
Given a list of model formulas, this function will train such models and return the a single(ensemble) prediction from the list of formulas on a test data set. It may also provides a k-nearest neighbors (KNN) prediction using the features listed in such models.
Usage
ensemblePredict(formulaList,
trainData,
testData = NULL,
predictType = c("prob", "linear"),
type = c("LOGIT", "LM", "COX","SVM"),
Outcome = NULL,
nk = 0
)
Arguments
formulaList |
A list made of objects of class |
trainData |
A data frame with the data to train the model, where all variables are stored in different columns |
testData |
A data frame similar to |
predictType |
Prediction type: Probability ("prob") or linear predictor ("linear") |
type |
Fit type: Logistic ("LOGIT"), linear ("LM"), or Cox proportional hazards ("COX") |
Outcome |
The name of the column in |
nk |
The number of neighbors used to generate the KNN classification. If zero, k is set to the square root of the number of cases. If less than zero, it will not perform the KNN classification |
Value
ensemblePredict |
A vector with the median prediction for the |
medianKNNPredict |
A vector with the median prediction for the |
predictions |
A matrix, where each column represents the predictions made with each model from |
KNNpredictions |
A matrix, where each column represents the predictions made with a different KNN model |
wPredict |
A vector with the weighted mean ensemble |
Author(s)
Jose G. Tamez-Pena and Antonio Martinez-Torteya