coef.l2boost | R Documentation |
coef
is a generic function which extracts model coefficients from objects returned by modeling functions.By default, coef.l2boost
returns the model (beta) coefficients from the last step,
M of the l2boost
model. For a cv.l2boost
object, the default returns the coefficients from
model at the cross-validation optimal step (m = opt.step return value).
Coefficients from alternative steps along the solution can be obtained using the m parameter.
## S3 method for class 'l2boost' coef(object, m = NULL, ...)
object |
an l2boost fit object ( |
m |
the iteration number within the l2boost solution path. If m=NULL, the coefficients are obtained from the last iteration M. |
... |
other arguments passed to generic function. |
vector of coefficient estimates for l2boost
objects.
The estimates correspond to the given iteration number m, or the final step M.
coef
and l2boost
, cv.l2boost
and
predict.l2boost
methods of l2boost.
#-------------------------------------------------------------------------- # Example: Diabetes data # # See Efron B., Hastie T., Johnstone I., and Tibshirani R. # Least angle regression. Ann. Statist., 32:407-499, 2004. data(diabetes, package='l2boost') object <- l2boost(diabetes$x,diabetes$y, M=1000, nu=.01) coef(object) # At the m=500 step coef(object, m=500)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.