Ensemble model Doubt from article How to build Ensemble Models in machine learning? (with code in R)

ensemble_methods
ensemble

#1

In step 2 why did we use order?? Please help

Step 2: Predict using each base layer model for training data and test data

#Predicting the out of fold prediction probabilities for training data
trainSet$OOF_pred_rf<-model_rf$pred$Y[order(model_rf$pred$rowIndex)]
trainSet$OOF_pred_knn<-model_knn$pred$Y[order(model_knn$pred$rowIndex)]
trainSet$OOF_pred_lr<-model_lr$pred$Y[order(model_lr$pred$rowIndex)]

URL:https://www.analyticsvidhya.com/blog/2017/02/introduction-to-ensembling-along-with-implementation-in-r/#comment-133182


#2

Order is used to sort the row index of the particular model predictions (in this example)