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

Description Usage Arguments Value References Examples

View source: R/ensemble_prediction.R

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

1
ensemble_prediction(ensemble_model, predition_data, mutiple_results = FALSE)

Arguments

ensemble_model

ensemble model which built by ensemble_model() function

predition_data

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

mutiple_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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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,
predition_data = datamatrix[,testingset])

EnMCB documentation built on Dec. 22, 2020, 2 a.m.