Hi everyone in R land,

   I'm trying to help a colleague who ran the follow script to develop
boosted regression tree models on fish traits.
He's run models on eight fish traits as the response variable with a sample
size of 1048, models for six of the fish traits seem to run properly but
with 2 variables the models stop after only 50 trees and gives this
statement (warning or error ?) "folds are unstratified". Initially these
two variables show up as integers while the others are numeric but that
shouldn't be the problem. However, the results show that the "total mean
deviance" 66 billion + for Ave_FECUNDITYr is way out there.The traits that
he's trying to model that don't work are Ave Fecundity (number of eggs per
fish species, very large numbers) and Ave Maximum Total Length which are
not particularly large numbers. I tried googling this issue of "fold are
unstratified" and couldn't find anything.
Has anyone run into this problem before. We are using Elith's code which is
modified from De'ath's original gbm code.
   Any suggestions would be appreciated. Original script and output copied
below.

Cheers and Thanks,
    Ian


#~~~~~~~~~~~~~~~~ original script ~~~~~~~~~~~
library (gbm)

set.seed(7)
gbm_n <- gbm.step(data=RTrait,
                  gbm.x = c(3:5, 7, 9, 22,35:43, 52:66,69:72,79:84), ##
explanatory variables
                  gbm.y = 89,           # (Ave_FECUNDITYr)
                  family = "gaussian",
                  tree.complexity = 8,
                  learning.rate = 0.001,
                  bag.fraction=0.50)
par(mfrow=c(3,4))
gbm.plot(gbm_n,n.plots=12)
gbm_n$contributions



#~~~~~~~ Output from gbm Boosted Regression Tree models ~~~~~~~~~~
Hey Ian,

I got those traits to show up as numbers but it's still doing the same
thing- 10 of 50 trees thing: below is the output from the run I just
did...it plots but doesn't seem like their any power associated with these
relationships.
        ~~~~~~~~~~~~
OUTPUT --

 "Performing cross-validation optimisation of a boosted regression tree
model
     for Ave_FECUNDITYr with dataframe RTrait and using a family of
gaussian

Using 1048 observations and 40 predictors

creating 10 initial models of 50 trees

* folds are unstratified *

total mean deviance =  66375444926

tolerance is fixed at  66375445

ntrees resid. dev.
50    64643104316

now adding trees...
fitting final gbm model with a fixed number of  50  trees for
 Ave_FECUNDITYr

mean total deviance = 66375444926
mean residual deviance = 63992100339

estimated cv deviance = 64643104316 ; se = 5286718478

training data correlation = 0.704
cv correlation =  0.568 ; se = 0.027

elapsed time -  0.09 minutes

-- 

~~~~~~~```````````~~~~~~~~~`````````~~~~~~~~~```````````~~~~~~~~~~
Ian R. Waite, Ph.D
Aquatic Ecologist
U.S. Geological Survey
Portland, OR 97201
503-251-3463
                       "Nature is a giver, helper, true friend and
sustainer.
                           It is constant harmony."

	[[alternative HTML version deleted]]

