[R] GBM package: Extract coefficients

Kyle Werner kylewerner10 at gmail.com
Mon Dec 14 09:43:10 CET 2009


I am using the gbm package for generalized boosted regression models,
and would like to be able to extract the coefficients produced for
storage in a database.

I am already using R to automatically generate formulas that I can
export to a database and store. For example, I have been using Dr.
Harrell's lrm package to perform logistic regression, e.g.:

output <- lrm(outcome~predictor1+predictor2,data=dataset)
cat(output$coefficients)

This allows me to take input (predictor1) from a user, multiply it by
the correctly transformed $coefficient, and to produce a success
probability without having to run R again.

Is it possible to do this with gbm? If not in general, is it perhaps
at least possible to do so in the case where interaction.depth=1
(e.g., no interactions are allowed)?

Thank you for any insight!




More information about the R-help mailing list