The local variable 'best' was never referred to and predict.gbm would crash if n.trees wasn't supplied as an argument. Clearly the default value for n.trees should be the maximum number of trees trained, and I believe that is the intention of the if block.
The local variable 'best' was never referred to and predict.gbm would crash if n.trees wasn't supplied as an argument. Clearly the default value for n.trees should be the maximum number of trees trained, and I believe that is the intention of the if block.