Questions tagged [gbm]

R package gbm, implementing Generalized Boosted Regression Models library.

R package gbm, implementing Generalized Boosted Regression Models library.

This package implements extensions to Freund and Schapire’s AdaBoost algorithm and Friedman’s gradient boosting machine.

Includes regression methods for least squares,absolute loss, t-distribution loss, quantile regression,logistic, multinomial logistic, Poisson, Cox proportional hazards partial likelihood, AdaBoost exponential loss, Huberized hinge loss, and Learning to Rank measures (LambdaMart).

Who's using gbm?

The gbm package is used in examples in Software for Data Analysis by John Chambers.

gbm is also used in Elements of Statistical Learning by Hastie, Tibshirani and Friedman.

Richard A. Berk also uses gbm in his book, Statistical Learning from a Regression Perspective.

Source: gradientboostedmodels

330 questions
3
votes
1 answer

GBM Bernoulli returns no results with NaN

I know this question has been asked multiple times but I've run out of ideas to get the model working. The first 50 rows of the train data: > train[1:25] a b c d e f g h i j k l m 1: 0 148.00 27 16 0 A 0 117 92 0 …
Ankhnesmerira
  • 1,386
  • 15
  • 29
3
votes
1 answer

xgboost error message about numerical variable and label

I use the xgboost function in R, and I get the following error message bst <- xgboost(data = germanvar, label = train$Creditability, max.depth = 2, eta = 1,nround = 2, objective = "binary:logistic") Error in xgb.get.DMatrix(data, label, missing,…
신익수
  • 67
  • 3
  • 8
3
votes
2 answers

How to reproduce the H2o GBM class probability calculation

I've been using h2o.gbm for a classification problem, and wanted to understand a bit more about how it calculates the class probabilities. As a starting point, I tried to recalculate the class probability of a gbm with only 1 tree (by looking at the…
3
votes
2 answers

Process categorical features when building decision tree models

I was using H2O to build classification models like GBM, DRF and DL. The dataset I have contains a few categorical columns, and if I want to use them as features for building models do I need to manually convert them into dummy variables? I read…
Selena
  • 243
  • 1
  • 2
  • 7
3
votes
2 answers

how can I print variable importance in gbm function?

I used the gbm function to implement gradient boosting. And I want to perform classification. After that, I used the varImp() function to print variable importance in gradient boosting modeling. But... only 4 variables have non-zero importance.…
이순우
  • 79
  • 1
  • 1
  • 10
3
votes
1 answer

Why does gbm() give different results than h2o.gbm() in this minimal example?

Tinkering with gradient boosting and I noticed R's gbm package produces different results than h2o on a minimal example. Why? Data library(gbm) library(h2o) h2o.init() train <- data.frame( X1 = factor(c("A", "A", "A", "B", "B")), X2 =…
Ben
  • 20,038
  • 30
  • 112
  • 189
3
votes
2 answers

Change x and y labels on a gbm partial plot

I am having trouble changing the x and y labels on a partial plot for a gbm model. I need to rename them for the journal article. I read this in and create the plot as follows: library(gbm) final<- readRDS(final_gbm_model) summary(final,…
user29609
  • 1,991
  • 18
  • 22
3
votes
1 answer

run h2o algorithms inside a foreach loop?

I naively thought it's straight forward to make multiple calls to h2o.gbm in parallel inside a foreach loop. But got a strange error. Error in { : task 3 failed - "java.lang.AssertionError: Can't unlock: Not locked!" Codes below…
horaceT
  • 621
  • 13
  • 26
3
votes
2 answers

Is there a parallel implementation of GBM in R?

I use the gbm library in R and I would like to use all my CPU to fit a model. gbm.fit(x, y, offset = NULL, misc = NULL,...
Boris LIM
  • 73
  • 1
  • 4
3
votes
1 answer

Error "Could not find function" in 'caret' package, R

I am trying to run "gbm" via caret package in R. Receiving an 'method "gbm.fit" is not found' error. gbm package is loaded, R, RStudio, caret and gbm are updated to their latest versions (see version info below) Here is an [reproducible]…
Alex Lizz
  • 425
  • 1
  • 8
  • 19
3
votes
1 answer

How can I export a gbm model in R?

Is there a standard (or available) way to export a gbm model in R? PMML would work, but when I I try to use the pmml library, perhaps incorrectly, I get an error: For example, my code looks similar to this: library("gbm") library("pmml") …
Josh Marcus
  • 1,749
  • 18
  • 30
3
votes
3 answers

R - Caret - Using ROC instead of accuracy in model training

Hi my name is Abhi and I am using caret to build a gbm trees based model. However instead of accuracy I would like to use roc as my metric Here is the code I have so far myTuneGrid <- expand.grid(n.trees = 500,interaction.depth = 11,shrinkage =…
Abhi
  • 399
  • 2
  • 7
  • 21
3
votes
2 answers

extract predictor names from varImp

I am using the caret package to run a gbm model. Once the model is run, I use the varImp function to extract the list of important predictors (displays top 20). However I would like to capture the names of the predictors in a character list. How do…
chittip
  • 31
  • 1
  • 2
3
votes
1 answer

R gbm.more() function doesn't work for all distributions?

I am trying to use the gbm.more function in R. For the purpose of clarity I have used the canonical iris data. When I specify distribution="multinomial" the code below doesn't work, but when I specify distribution="gaussian", the code works. Is…
3
votes
2 answers

Classification with gbm() - errors

cancer <- read.csv('breast-cancer-wisconsin.data', header = FALSE, na.strings="?") cancer <- cancer[complete.cases(cancer),] names(cancer)[11] <- "class" cancer[, 11] <- factor(cancer[, 11], labels = c("benign",…
hans-t
  • 3,093
  • 8
  • 33
  • 39