-1

I'm having trouble parsing the help files for the predict() function when using a glmnet()-defined model. I don't see mention of an 's' argument anywhere. However, in the example code below, it appears to be a way to feed a regularization parameter (often labeled lambda).

y_lasso = predict(lasso, X, s = lambda)

What is the s argument for, and where is it documented?

I have tried looking up help on predict, glm.predict, glm.SafePrediction, with no luck.

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
TheProletariat
  • 916
  • 2
  • 11
  • 23
  • The `predict` method of `glmnet` objects is listed in the docs for the `glmnet` package, i.e. `?predict.glmnet`. Is there more to the question than where to find the documentation? – camille Jul 03 '19 at 22:27
  • I was asking what the s parameter is for in glmnet, and I couldn't find it in the documentation. I realize it may be a dumb question, and I should be better at finding the proper documentation, but it's certainly not an unclear one. That being said, I'll add some carriage returns to make the exact question more prominent. – TheProletariat Jul 25 '19 at 16:14

1 Answers1

4

I think you want the documentation for predict.glmnet.

s - Value(s) of the penalty parameter lambda at which predictions are required. Default is the entire sequence used to create the model.

neilfws
  • 32,751
  • 5
  • 50
  • 63