How to specify the number of trees in gradient boosting while using caret

r
caret
gradient_boosting

#1

hello,

While using gradient boosting and random forests I got some doubts:

1.When should we use one over the other.

2 .modFit <- train(member_card ~ ., method="gbm",data=training,verbose=FALSE)
I am using the caret package to train so wanted to know if there is a way to specify the number of trees in this model.

Can someone please help me with these??