I want to Ensemble my predictions for the StratifiedKFold of LGBM and XGBoost into another LGBM Model. I had written the following code which works when the data set has an ID_COL, but in this data set I don't have any ID_COL. It is simply based on the index. How can I ensemble the model in such case?

The Train and Test data are stored in train and test file respectively.


train_new = train[[TARGET_COL]]

test_new = test[[ID_COL]] #ID_COL is not available in data.

train_new['lgb'] = lgb_oofs
test_new['lgb'] = lgb_preds

train_new['xgb'] = xgb_oofs
test_new['xgb'] = xgb_preds

After this I pass train_new and test_new to a LGBM Model.

  • $\begingroup$ you want two ensemble 2 gradient boosting with another gradietn boosting? So the ensembler only sees two columns with the predictions/ $\endgroup$ – Carlos Mougan Oct 7 '20 at 10:44
  • $\begingroup$ There are many way to ensemble (voting, bagging, boosting)? Please be more specific. $\endgroup$ – Brian Spiering Mar 10 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.