From 3da261b6e7e867af58bd019a64c1c3b2402b98e5 Mon Sep 17 00:00:00 2001 From: El Potaeto Date: Fri, 13 Feb 2015 18:49:53 +0100 Subject: [PATCH] add linear boosting part --- R-package/vignettes/xgboostPresentation.Rmd | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/R-package/vignettes/xgboostPresentation.Rmd b/R-package/vignettes/xgboostPresentation.Rmd index d43459456..66d97fdfe 100644 --- a/R-package/vignettes/xgboostPresentation.Rmd +++ b/R-package/vignettes/xgboostPresentation.Rmd @@ -301,6 +301,15 @@ bst <- xgb.train(data=dtrain, max.depth=2, eta=1, nround=2, watchlist=watchlist, > `eval.metric` allows us to monitor two new metrics for each round, logloss and error. +Until know, all the learnings we have performed were based on boosting trees. **Xgboost** implements a second algorithm, based on linear boosting. The only difference with previous command is `booster = "gblinear"` parameter (and removing `eta` parameter). + +```{r linearBoosting, message=F, warning=F} +bst <- xgb.train(data=dtrain, booster = "gblinear", max.depth=2, nround=2, watchlist=watchlist, eval.metric = "error", eval.metric = "logloss", objective = "binary:logistic") +``` + +In this specific case, linear boosting gets sligtly better performance metrics than decision trees based algorithm. In simple case, it will happem because there is nothing better than a linear algorithm to catch a linear link. However, decision trees are much better to catch a non linear link between predictors and outcome. Check both implementations with your own dataset to have an idea of what to use. + + Manipulating xgb.DMatrix ------------------------