View source: R/ensemble_prediction.R
ensemble_prediction | R Documentation |
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.
ensemble_prediction(ensemble_model, prediction_data, multiple_results = FALSE)
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. |
Object of numeric class double
Xin Yu et al. 2019 Predicting disease progression in lung adenocarcinoma patients based on methylation correlated blocks using ensemble machine learning classifiers (under review)
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])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.