Open GoogleCodeExporter opened 9 years ago
One other note: this does not seem to occur when called using gbm()
> dat <- mdrrDescr[, 1:20]
> dat$y <- ifelse(mdrrClass == "Active", 1, 0)
> set.seed(1)
> gbm1 <- gbm(y ~ ., data = dat,,
+ distribution = "bernoulli")
> gbm1
gbm(formula = y ~ ., distribution = "bernoulli", data = dat)
A gradient boosted model with bernoulli loss function.
100 iterations were performed.
There were 20 predictors of which 5 had non-zero influence.
> predict(gbm1, head(mdrrDescr), n.trees = 100, type = "response")
[1] 0.5404099 0.5619192 0.5301132 0.5255829 0.5619192 0.5371400
>
>
> count <- 0
> for(i in 1:100)
+ {
+ gbm1 <- gbm(y ~ ., data = dat, distribution = "bernoulli")
+ prd <- predict(gbm1, head(mdrrDescr), n.trees = 100, type = "response")
+ if(any(is.na(prd))) count <- count + 1
+ }
> count
[1] 0
Original comment by MxK...@gmail.com
on 6 Feb 2013 at 4:39
I also come cross such problem.
Original comment by guoshich...@gmail.com
on 20 Feb 2014 at 6:28
it will be ok when I replace bernoulli with gaussian
gbm1 <- gbm.fit(mdrrDescr[, 1:20], ifelse(mdrrClass == "Active", 1, 0),
distribution = "bernoulli")
Original comment by guoshich...@gmail.com
on 20 Feb 2014 at 6:29
I was having similar issues, and it seemed that converting the response to a "logical" solved the issue. If the data is called d
and the response is called y
:
d$y <- as.logical(asinteger(d$y)-1)
Then run the gbm function with this.
Original issue reported on code.google.com by
MxK...@gmail.com
on 6 Feb 2013 at 3:54