2

After building the Lasso model as follows, I would like to get see the model coefficient.

fit<-glmnet(as.matrix(x),y,alpha=1)

The Glmnet website http://web.stanford.edu/~hastie/glmnet/glmnet_alpha.html shows the following command. I do not understand the meaning of s here. When removing s, the coef(fit) will return a matrix, which is not very understandable.

enter image description here

user785099
  • 5,323
  • 10
  • 44
  • 62
  • 2
    the coefficients are computed for a variety/range of values of the penalization parameter (lambda): see `?coef.glmnet`. If you don't pick one, it will show you the coefficients for all values of `s`/lambda that have been tried. – Ben Bolker Nov 09 '14 at 02:29

0 Answers0