# Ensemble Probabilities of the different models

I have a Multiclass Dataset and I am getting probabilities of classes from RandomForest.

However, I want to divide the dataset for each class as examples of either the case belongs to that class or not(Binary Classification). I want to know , when I get the prediction of those models for a yes or no.

How can I ensemble them in such a way that Overall Sum of probabilities as one?

I think it can be done by using this command at the time of prediction, giving example in R

#To predict with probabilities
testSet$pred_rf_prob<-predict(object,model_rf,testSet[,predictors],type='prob')  To take average of the predictions: testSet$pred_avg<-(testSet$pred_rf_prob$Y+testSet$pred_knn_prob$Y+testSet$pred_lr_prob$Y)/3


Let me know if you have any additional questions.

• Don't know about R. Working in python. Can you help me in that? Nov 18, 2017 at 10:59
• sure will have a look and update you in sometime. Nov 18, 2017 at 11:00
• Do go through this Link, here you have something called as Probability, clf3 = SVC(kernel='rbf', probability=True). I think that might work, have a look but i'm not sure. Nov 18, 2017 at 11:12
• @Toros91 It seems to me you are missing the essential part of OP's question which relates to handling probabilities out of a series of 1-vs-1 models defined from an original 1-vs-all problem setting. Nov 18, 2017 at 14:56
• yes, i understood that part, try giving Probabilities to False and see how it works. Nov 18, 2017 at 15:12