March 2019
Beginner to intermediate
250 pages
6h 6m
English
This is simply defined as taking the average of the predictions from the models:
summary_models_test$avg<-(summary_models_test$GLM + summary_models_test$RF + summary_models_test$GBM + summary_models_test$deep + summary_models_test$SVM)/5
Thus, the final probability of the failure of a bank will be calculated as the simple average of the probabilities of failure of the previous five models.
The predictive power of this simple ensemble is as follows:
abs(as.numeric(2*rcorr.cens(summary_models_test[,"avg"],summary_models_test$Default)[1]-1)) ## [1] 0.9771665
We can create a confusion matrix as follows:
aux<-summary_models_testaux$pred<-ifelse(summary_models_test$avg>0.04696094,1,0)table(aux$Default,aux$pred) ## 0 1 ## 0 2834 62 ...
Read now
Unlock full access