How to resolve cannot compute OOB estimate or the OOB curve error in gbm using R




While trying to use gbm I have got stuck in an error:


 train.rose$Churn <- ifelse(train.rose$Churn == "Yes",1,0)
    fit.gbm<[,1:17], as.factor(train.rose[,18]), n.tree=500,
                     interaction.depth=4, shrinkage=0.001,verbose=FALSE,bag.fraction = 0.5,
                     distribution = "bernoulli")

Why is this error cropping up?
However,if I use distribution as laplace it works and the OOB curve is:

I am using bernoulli distribution as I want to model Churn as 1/0 but then with it the OOB curve is not getting generated.
Can someone please help me regarding this??



my guess is that the OOB does not manage to calculate a significant reduction in deviance. Did you try with CV, as OOB underestimate the deviance the CV could give you better results.
Why Laplace works? Same the calculation of deviance is different as well as the other values, median, initial value etc

Hope this help a little