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 formula, each representing a model formula to be fitted and predicted with

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 trainData, but with the data set to be predicted. If NULL, trainData will be used

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 data that stores the variable to be predicted by the model

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 testData data set, using the models from formulaList

medianKNNPredict

A vector with the median prediction for the testData data set, using the KNN models

predictions

A matrix, where each column represents the predictions made with each model from formulaList

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


[Package FRESA.CAD version 3.4.7 Index]