I am trying to run a gbm
gbm(formula=loan_status~., data=mdTrnGBM, distribution = 'bernoulli', n.trees= 100, interaction.depth= 5, bag.fraction= 0.5, cv.folds= 5)
and keep getting this error:
Error in makePSOCKcluster(names = spec, ...) : Cluster setup failed. 8 of 8 workers failed to connect.
Any ideas on how to fix this? If I eliminate the bag fraction and cv folds it does tend to work, but I don't want to have to eliminate those.
When you specify cv=5,
gbm
uses theparallel
package to send each cross-validation job to a separate core. This might be a new problem with new R 4.0 and mac.. or whatever system you might be working with, see this link.Right now you can try using only 1 core if your data isn't so huge, using an example dataset: