Predictive Modelling: Averaging Results from Multiple Models
Premium
Our final model is to combine the result of previous machine learning models and provide a single prediction by averaging probabilities from all previous models.
1predict_loan_status_ensemble = predict_loan_status_logit +
2 predict_loan_status_svm +
3 predict_loan_status_rf +
4 predict_loan_status_xgb
5predict_loan_status_ensemble = predict_loan_status_ensemble / 4
6rocCurve_ensemble = roc(response = data_test$loan_status,
7 predictor = predict_loan_status_ensemble)
8auc_curve = auc(rocCurve_ensemble)
9plot(rocCurve_ensemble,legacy.axes = TRUE,print.auc = TRUE,col="red",main="ROC(Ensemble Avg.)")
10
Unlock Premium Content
Upgrade your account to access the full article, downloads, and exercises.
You'll get access to:
- Access complete tutorials and examples
- Download source code and resources
- Follow along with practical exercises
- Get in-depth explanations