Hi,
I am having problems passing arguments to method="gbm" using the train()
function.
I would like to train gbm using the laplace distribution or the quantile
distribution.
here is the code I used and the error:
gbm.test <- train(x.enet, y.matrix[,7],
method="gbm",
distribution=list(name="quantile",alpha=0.5), verbose=FALSE,
trControl=trainControl(method="cv",number=5),
tuneGrid=gbmGrid
)
Model 1: interaction.depth=1, shrinkage=0.1, n.trees=300
collapsing over other values of n.trees
Error in gbm.fit(trainX, modY, interaction.depth =
tuneValue$.interaction.depth, :
formal argument "distribution" matched by multiple actual arguments
The same error occured with distribution="laplace".
I also tried the following without and success :
gbm.test <- train(x.enet, y.matrix[,7],
method="gbm",
list(distribution="laplace", verbose=FALSE),
trControl=trainControl(method="cv",number=2),
tuneGrid=gbmGrid
)
Model 1: interaction.depth=1, shrinkage=0.1, n.trees=300
collapsing over other values of n.trees
Error in if (is.null(offset) || (offset == 0)) { :
missing value where TRUE/FALSE needed
In addition: Warning message:
In gbm.fit(trainX, modY, interaction.depth = tuneValue$.interaction.depth,
:
NAs introduced by coercion
Any help would be appreciated.
Cheers
Peter
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.