Setting the penalty for logistic and multinomial regression with glmnet #863
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #858
This PR moves where we set
s, glmnet's argument for the penalty value, from inside the relevantmulti_predict()method into the relevantpredict_raw()method.This means that now the default penalty value specified in the parsnip spec will be used when
penalty = NULL, also for fortype = "raw"(aka the original issue).This also means that the call stack for
multi_predict()for logistic and multinomial regression now follows that of linear regression and what happens in the code is what was laid out in the comments, e.g.,parsnip/R/logistic_reg.R
Lines 209 to 234 in 2249cbb
The tests are in extratests: tidymodels/extratests#72
Created on 2023-01-25 with reprex v2.0.2