ensemble_prediction: fitting function using stacking ensemble model for...

View source: R/ensemble_prediction.R

ensemble_predictionR Documentation

fitting function using stacking ensemble model for Methylation Correlation Block

Description

predict is a generic function for predictions from the results of stacking ensemble model fitting functions. The function invokes particular methods which is the ensemble model described in the reference.

Usage

ensemble_prediction(ensemble_model, prediction_data, multiple_results = FALSE)

Arguments

ensemble_model

ensemble model which built by ensemble_model() function

prediction_data

A vector, matrix, list, or data frame containing the predictions (input).

multiple_results

Boolean vector, True for including the single model results.

Value

Object of numeric class double

References

Xin Yu et al. 2019 Predicting disease progression in lung adenocarcinoma patients based on methylation correlated blocks using ensemble machine learning classifiers (under review)

Examples

library(survival)
#import datasets
data(demo_survival_data)
datamatrix<-create_demo()
data(demo_MCBinformation)
#select MCB with at least 3 CpGs.
demo_MCBinformation<-demo_MCBinformation[demo_MCBinformation[,"CpGs_num"]>2,]
trainingset<-colnames(datamatrix) %in% sample(colnames(datamatrix),0.6*length(colnames(datamatrix)))
testingset<-!trainingset
#select one MCB
select_single_one=1
em<-ensemble_model(t(demo_MCBinformation[select_single_one,]),
    training_set=datamatrix[,trainingset],
    Surv_training=demo_survival_data[trainingset])

em_prediction_results<-ensemble_prediction(ensemble_model = em,
prediction_data = datamatrix[,testingset])


whirlsyu/EnMCB documentation built on Jan. 25, 2023, 4:33 a.m.