[R] boosting
stephenc
mail at xesoftware.com.au
Thu May 25 06:35:25 CEST 2006
Hi
I am using boosting for a classification and prediction problem.
For some reason it is giving me an outcome that doesn't fall between 0
and 1 for the predictions. I have tried type="response" but it made no
difference.
Can anyone see what I am doing wrong?
Screen output shown below:
> boost.model <- gbm(as.factor(train$simNuance) ~ ., # formula
+ data=train, # dataset
+ # +1: monotone increase,
+ # 0: no monotone restrictions
+ distribution="gaussian", # bernoulli, adaboost, gaussian,
+ # poisson, and coxph available
+ n.trees=3000, # number of trees
+ shrinkage=0.005, # shrinkage or learning rate,
+ # 0.001 to 0.1 usually work
+ interaction.depth=3, # 1: additive model, 2: two-way
interactions, etc.
+ bag.fraction = 0.5, # subsampling fraction, 0.5 is
probably best
+ train.fraction = 0.5, # fraction of data for training,
+ # first train.fraction*N used
for training
+ n.minobsinnode = 10, # minimum total weight needed in
each node
+ cv.folds = 5, # do 5-fold cross-validation
+ keep.data=TRUE, # keep a copy of the dataset
with the object
+ verbose=FALSE) # print out progress
>
> best.iter = gbm.perf(boost.model,method="cv")
> pred = predict.gbm(boost.model, test, best.iter)
> summary(pred)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.4772 1.5140 1.6760 1.5100 1.7190 1.9420
-------------- next part --------------
Checked by AVG Free Edition.
More information about the R-help
mailing list