Skip to content

glmnet penalty parameter  #195

Closed
Closed
@topepo

Description

@topepo

Right now, if a modeling function using glmnet gets a specific penalty value, the model cannot make predictions on any other values. If no value is given, the model can predict on anything but there is no default value to be used with predict().

I propose doing what caret does:

  • if a penalty value is given, save it but do not pass that value to the lambda argument to glmnet.
  • attach the supplied penalty value to the the glmnet fit object.
  • when using predict(), use the value attached to the glmnet object.

It is suboptimal to modify the underlying object but that would enable use to have the best of both worlds; predict() works as expected (and without error) and multi_predict() can also be used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions