I am referring to this link to Feature Transformation using tree ensembles for the context.
Specifically for below part of code, in the sample of the link, the method of (1) using Boosting tree to generate feature, then using LR to train, outperforms (2) using Boosting tree itself. Questions,
And also wondering why using Boosting tree to generate feature, then using LR to train, outperforms using Boosting tree itself?
grd = GradientBoostingClassifier(n_estimators=n_estimator)
grd_enc = OneHotEncoder()
grd_lm = LogisticRegression()
grd.fit(X_train, y_train)
grd_enc.fit(grd.apply(X_train)[:, :, 0])
grd_lm.fit(grd_enc.transform(grd.apply(X_train_lr)[:, :, 0]), y_train_lr)
XGBoost is easy to implement in scikit-learn. XGBoost is an ensemble, so it scores better than individual models.
Gradient boosting can be used for regression and classification problems.
The power of gradient boosting machines comes from the fact that they can be used on more than binary classification problems, they can be used on multi-class classification problems and even regression problems.
Interesting sources are paper_1 and paper_2 and additional references in them.
So to answer your questions:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With