I have prediction of my data in different classifier. I would like to ensemble the results of them in order to get better final result. Is it possible in R?
lets say:
SVMpredict=[1 0 0 1...]
RFpredict=[1 1 0 1 ...]
NNpredict=[0 0 0 1 ...]
is it possible to combine results by any ensemble technique in R?how?
thanks
Edited:
I run my classifiers on different samples (my case DNA chromosomes). In some samples SVM works better than the others like RF. I want a technique to ensemble the results by considering which classifier works better.
for example if i take average of output probabilities and round them, it would be considered as all classifier are equal effective in result. but when SVM worked better, we should consider results for SVM (with 86% accuracy) has 60% importance and 25% (72% accuracy) for RF and 15% NN (64% accuracy). (these numbers are just examples for clarification)
is there anyway that I can do that?
It depends on the structure of the output of Your classifier. If it is {0,1} outcome, as You provided, You can just make mean of the predictions and then average it and round it:
round((SVMpredict+RFpredict+NNpredict)/3)
If You know performance of the classifiers, weighted mean is a good idea - favor the ones that perform better. Hardcore apporach is to optimize weights via optim
function.
If You know class probabilites for each prediction, it is better average them instead of letting them just vote ({0,1} output case above).